美文网首页
nginx 解决伪静态,服务器500错误 --- 2021-11

nginx 解决伪静态,服务器500错误 --- 2021-11

作者: 一位先生_ | 来源:发表于2021-11-08 17:05 被阅读0次

    个人项目nginx配置项目实例代码(解决伪静态,服务器500错误)

    
    server {
    
            listen 80 default_server reuseport;
    
            server_name _;
    
            root  /home/wwwroot/tp6/public;
    
            index  index.php index.html index.htm;
    
            location / {
    
                if (!-e $request_filename) {
    
                    rewrite ^/index.php(.*)$ /index.php?s=$1 last;
    
                    rewrite ^(.*)$ /index.php?s=$1 last;
    
                    break;
    
                }
    
            }
    
            location ~ \.php$ {
    
                root          /home/wwwroot/tp6/public;
    
                fastcgi_pass  127.0.0.1:9000;
    
                fastcgi_index  index.php;
    
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    
                include        fastcgi_params;
    
            }
    
        }
    
    

    相关文章

      网友评论

          本文标题:nginx 解决伪静态,服务器500错误 --- 2021-11

          本文链接:https://www.haomeiwen.com/subject/uyzuzltx.html