nginx自动生成的
1 server { 2 listen 80; 3 server_name www.yunyuecrm.com yunyuecrm.com; 4 root "E:/phpStudy/WWW/yunyuecrm/public"; 5 location / { 6 index index.html index.htm index.php; 7 #autoindex on; 8 } 9 location ~ \.php(.*)${content}nbsp;{ 10 fastcgi_pass 127.0.0.1:9000; 11 fastcgi_index index.php; 12 fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; 13 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 14 fastcgi_param PATH_INFO $fastcgi_path_info; 15 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 16 include fastcgi_params; 17 } 18 }
自要加上这个就可以了 if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
1 server { 2 listen 80; 3 server_name www.yunyuecrms.com yunyuecrm.com; 4 root "E:/phpStudy/WWW/yunyuecrm/public"; 5 location / { 6 index index.html index.htm index.php; 7 #autoindex on; 8 if (!-e $request_filename) { 9 rewrite ^(.*)${content}nbsp;/index.php?s=$1 last; 10 break; 11 } 12 } 13 location ~ \.php(.*)${content}nbsp;{ 14 fastcgi_pass 127.0.0.1:9000; 15 fastcgi_index index.php; 16 fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; 17 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 18 fastcgi_param PATH_INFO $fastcgi_path_info; 19 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 20 include fastcgi_params; 21 } 22 }