nginxfastcgi Myth丶恋晨 2023-10-11 18:57 17阅读 0赞 ### Nginx 配置中 fastcgi\_index 起什么作用? ### 关于fastcgi\_index是这么说的 如果请求的FastCGIURI以/结束,该指令设置的文件会被附加到URI的后面并保存在变量$fastcgi\_script\_name中 而index是: 该指令用于设置nginx的默认首页文件 而我们的配置经常是 location~\*\\.php$\{ fastcgi\_passcos\_ups; fastcgi\_indexindex.php; includefastcgi.conf; 在这里指定fastcgi\_index其实是没有用的,因为前面的location~\*\\.php$已经把“/结束”这种情况排除了 ![nginxfastcgi\_nginxfastcgi][nginxfastcgi_nginxfastcgi] ### 为什么nginx不能解析php文件,PHP,fastcgi,php\_fpm也安装了,也都启动了,配 ### 访问PHP文件成下载,这是nginx配置问题,原因是你没有把访问PHP文件的请求转发给PHP:9000端口,nginx本身不能解析.php文件,所以变成下载。你检查一下配置.我给示例,帮得到你希望给分:location~\\.php$\{fastcgi\_pass127.0.0.1:9000;fastcgi\_indexindex.php;fastcgi\_paramSCRIPT\_FILENAME$document\_root$fastcgi\_script\_name;includefastcgi\_params;\} [nginxfastcgi_nginxfastcgi]: https://img1.baidu.com/it/u=2651728171,2530508511&fm=26&fmt=auto
相关 nginxfastcgi Nginx 配置中 fastcgi\_index 起什么作用? 关于fastcgi\_index是这么说的 如果请求的FastCGIURI以/结束,该指令设置的文件会被 Myth丶恋晨/ 2023年10月11日 18:57/ 0 赞/ 18 阅读
还没有评论,来说两句吧...