nginx如何配置能够访问thinkphp路由?

我用的本地环境是:upupw 
现在路由都配置好了,却访问出错,说找不到该文件,报404错误。
请问nginx里应该怎么配置啊?

地址是这样的: http://localhost/index.php/ne... 这样就可以访问
我想让中间的index.php去掉,可是设置nginx一直无效
伪静态设置也照着别人的弄了,就是没用,搞了一下午了。


汪汪一只猫
浏览 898回答 1
1回答

宝慕林4294392

location ~ \.php {    #fastcgi_pass remote_php_ip:9000;     fastcgi_pass unix:/dev/shm/php-cgi.sock;     fastcgi_index index.php;    set $real_script_name $fastcgi_script_name;                                                                                                                                                                                                                            if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {                                                                                                                                                                                                                      set $real_script_name $1;        #set $path_info $2;     }     fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;      fastcgi_param SCRIPT_NAME $real_script_name;    #fastcgi_param PATH_INFO $path_info;     if (!-e $request_filename) {         rewrite ^(.*)$ /index.php?s=$1 last;        break;     } }
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python