lnmp环境下部署项目报404解决方案

windows 下面的解决方案,linux失效
server {
listen 80;
server_name 127.0.0.1 gohosts.com;
root F:\php\exilesystem;
location / {
if (!-e KaTeX parse error: Expected '}', got '#' at position 32: …) { #̲ 开启nginx的重写模块 … /index.php?s=/$1 last;
break;
}
index index.php index.html index.htm;
}

          location ~ \.php$ {         
              fastcgi_pass   127.0.0.1:9000;
             fastcgi_index  index.php;
              fastcgi_split_path_info ^(.+\.php)(.*)$;     #增加这一句  让nginx 支持pathinfo
               fastcgi_param PATH_INFO $fastcgi_path_info;    #增加这一句
            #  fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; # 09-20+
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # 09-20+
              include        fastcgi_params;
          }
          
   
       }

亲测可用

猜你喜欢

转载自blog.csdn.net/u014265398/article/details/89481065