Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-27, 21:52:38

Author Topic: need advice sama nginx rewrite rule  (Read 3903 times)

0 Members and 1 Guest are viewing this topic.

Offline prandah

  • Senior Member
  • *
  • Posts: 344
  • Karma: +0/-0
    • View Profile
    • https://www.bowo.name
need advice sama nginx rewrite rule
« on: 2013-03-24, 12:51:59 »
mohon bantuannnya. saya pakai vBulletin saya sedkit bingung dengan rule nginx :D

isi nya custom.domain.com.conf

Code: [Select]
### begin content - please not remove this line


## web for 'ditusuk.net'
server {
    listen xxx.xxx.xxx.xxx:80;

    server_name domain.net;

    index index.php index.html index.shtml index.htm default.htm Default.aspx Default.asp index.pl;

    set $domain 'domain.net';

    set $rootdir '/home/admin/domain';

    root $rootdir;

    set $user 'admin';

#    include '/home/nginx/conf/globals/generic.conf';

    access_log /home/httpd/domain.net/stats/ditusuk.net-custom_log main;
    error_log  /home/httpd/domain.net/stats/ditusuk.net-error_log;

    set $statstype 'awstats';

    include '/home/nginx/conf/globals/awstats.conf';

    set $fpmport '51006';

    include '/home/nginx/conf/globals/vb-fpm.conf';

    include '/home/nginx/conf/globals/perl.conf';

    include '/home/nginx/conf/globals/vb.conf';

    rewrite ^(.*) http://www.domain.net permanent;
}

isi dari vb.conf

Code: [Select]
[root@shack globals]# cat vb.conf
location = / {
        if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
        }
}
[root@shack globals]#

isi dari vb-fpm.conf

Code: [Select]
[root@shack globals]# cat vb-fpm.conf
location ~ .php$ {
        fastcgi_pass                                    127.0.0.1:$fpmport;
        fastcgi_index                                   index.php;
        include                                         /etc/nginx/fastcgi_params;
}

location ~ .php($|/) {
        set $script $uri;
        set $path_info "";

        if ($uri ~ "^(.+.php)(/.+)") {
                set $script $1;
                set $path_info $2;
        }

        fastcgi_pass                                    127.0.0.1:$fpmport;
        fastcgi_index                                   index.php;
        include                                         /etc/nginx/fastcgi_params;

        fastcgi_param                                   SCRIPT_FILENAME                 $document_root$script;
        fastcgi_param                                   SCRIPT_NAME                     $script;
        fastcgi_param                                   PATH_INFO                       $path_info;
}

    ### MR -- just enough remove # below for enable nginx cache
    fastcgi_cache fcache;
    fastcgi_cache_valid 200 1h;
    fastcgi_cache_valid 301 1h;
    fastcgi_cache_valid 302 1h;
    fastcgi_cache_valid any 1m;

    ### MR -- must be using nginx with including ngx_purge_cache
    ### must be using special nginx (nginx with ngx_purge_cache include
    location ~ /purge(/.*) {
        ### MR -- just enough remove # below for enable purge_cache
        #proxy_cache_purge pcache "$scheme://$host$1$request_method";
        allow 127.0.0.1;
        deny all;
    }

        ## MR - increasing upload size to 15M
        client_max_body_size 15M;
        client_body_buffer_size 128k;

        fastcgi_connect_timeout 120s;
        fastcgi_send_timeout 120s;
        fastcgi_read_timeout 120s;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 8 128k;

        try_files $uri $uri/ /index.php;
#    }
[root@shack globals]#

masalahnya kok gak bisa yah :D. permalink nya gak work :D
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline prandah

  • Senior Member
  • *
  • Posts: 344
  • Karma: +0/-0
    • View Profile
    • https://www.bowo.name
Re: need advice sama nginx rewrite rule
« Reply #1 on: 2013-03-24, 19:42:34 »
udah resolve juga :D
lupa gak di restart :P
« Last Edit: 1970-01-01, 01:00:00 by Guest »

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo

Page created in 0.029 seconds with 18 queries.

web stats analysis