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 返回想要的结果。

  • 相关阅读:
    业余时间决定人生
    单片机好网站
    坚持 放弃
    励志博客园网址
    资料下载好网站
    和易法
    二、栈
    一、顺序表
    uCOS任务中的OSTCBDly
    三(1)、队列(链队列)
  • 原文地址:https://www.cnblogs.com/handongyu/p/8259204.html
Copyright © 2011-2022 走看看