ThinkPHP在nginx下重寫規則配置

server {
        listen       80;
        server_name  www.test123.com;
        location / {
#            try_files $uri $uri/ /index.php?s=$uri&$args;
            root   /data/www/test123;
            index  index.html index.htm index.php;
            if (!-e $request_filename) {
                rewrite ^/index.php(.*)$ /index.php?s=$1 last;
                rewrite ^(.*)$ /index.php?s=$1 last;
            break;
        }
        }
        location ~ \.php$ {
            root           /data/www/test123;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }php

相關文章
相關標籤/搜索