如何解决ThinkPHP3.2.3在Nginx中访问路径导致404错误的问题?
- 内容介绍
- 文章标签
- 相关推荐
本文共计157个文字,预计阅读时间需要1分钟。
Nginx 默认不支持 PATHINFO 模式,需要修改 Nginx 配置文件。以下为修改后的配置示例:
nginxserver { listen 80; root /var/www/; index index. index.htm index.php; server_name _;
location / { try_files $uri $uri/=404; }
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }}
Nginx 默认是不支持 PATHINFO 模式的,需要修改下 Nginx 的配置文件。
本文共计157个文字,预计阅读时间需要1分钟。
Nginx 默认不支持 PATHINFO 模式,需要修改 Nginx 配置文件。以下为修改后的配置示例:
nginxserver { listen 80; root /var/www/; index index. index.htm index.php; server_name _;
location / { try_files $uri $uri/=404; }
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }}
Nginx 默认是不支持 PATHINFO 模式的,需要修改下 Nginx 的配置文件。

