lnmp环境搭建_LNMP下Nginx开启pathinfo模式支持的例子

更新时间:2020-11-28    来源:nginx    手机版     字体:

【www.bbyears.com--nginx】

LNMP上各个版本pathinfo的设置基本一样:

lnmp v1.1上,修改对应虚拟主机的配置文件

去掉#include pathinfo.conf前面的#,把try_files $uri =404; 前面加上# 注释掉

location ~ [^/]\.php(/|$)
{
    # comment try_files $uri =404; to enable pathinfo
    #try_files $uri =404;
    fastcgi_pass  unix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    include pathinfo.conf;
}

1.2,1.3上,修改对应虚拟主机的配置文件

将include enable-php.conf;替换为include enable-php-pathinfo.conf;
修改pathinfo需要重启nginx使之生效。

本文来源:http://www.bbyears.com/caozuoxitong/113234.html