nginx vhost配置

server
 {
    listen       80;
    server_name   crsdemo.my;
    index index.html index.htm index.php default.html default.htm default.php;
    root  /home/xss/www7/crs/public/admin;

    rewrite_log on;


    location ~* ^/(upload|static)/.*.(php|php5)$
    {
        rewrite  "^/(.*)$"  /static/405.html break;
    }


    if (!-f $request_filename) {
                            rewrite ^/$ /index.php last;
         rewrite ^/(?!(index.php|upload|static))(.*)$ /index.php?$1$2 last;
         rewrite ^/index.php(.*)$ /index.php?$1 last;
               }

    location ~ .php$ {
                fastcgi_pass 127.0.0.1:9007;
                fastcgi_index index.php;
                include fastcgi.conf;
     }

    access_log /home/xss/www/log/gjsgzgzpg.log;
    error_log  /home/xss/www/log/gjsgzgzpg.log notice;
    error_log /home/xss/www/log/gjsgzgzpg.log;
}
原文地址:https://www.cnblogs.com/mengluo/p/9003831.html