访问不了html文件 但是php文件可以
来源:2-3 Nginx和PHP如何配合工作

MichonneHsu
2020-04-23
老师,我看着没毛病啊 直接输入 127.0.0.1:8080可以访问到 控制器里的index
写回答
1回答
-
天经地义
2020-04-23
将root和index提取到server下面试下,直接使用如下配置重启nginx试下
server { listen 8080; server_name localhost; root /usr/local/lnmp/php/tp6store/public; index index.html index.htm index.php; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
042020-04-26
相似问题