zoukankan      html  css  js  c++  java
  • nginx 转发 由于php语法错误 导致的 50x

        server {
            listen 8008;
            root /root/php-test;
            index index.php index.html index.htm;

                location ~ .php {
                #fastcgi_pass unix:/tmp/php/php-fpm.sock;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index /index.php;
                fastcgi_split_path_info  ^(.+.php)(/.+)$;
                fastcgi_param PATH_INFO  $fastcgi_path_info;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /usr/local/openresty/nginx/conf/fastcgi.conf;
            }
            location / {
                try_files $uri $uri/ /index.php?$query_string;
            }

            fastcgi_intercept_errors on;

            error_page   500 502 503 504 =200  /50x.php;
            location = /50x.html {
                root   /root/php-test;
            }

            location ~ /.ht {
                deny all;
            }
        }

    重点:

            fastcgi_intercept_errors on;

            error_page   500 502 503 504 =200  /50x.php;
            location = /50x.html {
                root   /root/php-test;
            }

    将 /root/php-test/50x.php 返回想要的结果。

  • 相关阅读:
    P1099 [NOIP2007 提高组] 树网的核
    UVA 数学题选做
    Codeforces 729 Div.2
    P1600 [NOIP2016 提高组] 天天爱跑步
    CF1106F Lunar New Year and a Recursive Sequence
    P6091 【模板】原根
    P4774 [NOI2018] 屠龙勇士
    P1106 删数问题
    P1209 [USACO1.3]修理牛棚 Barn Repair
    网络(network)
  • 原文地址:https://www.cnblogs.com/handongyu/p/8259204.html
Copyright © 2011-2022 走看看