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

  • 相关阅读:
    ps photoshop cc 2015 Extract Assets(生成器)切图大法
    获取免费代理推荐
    nodejs http代理请求
    nodejs 发起http请求
    AHK GUI开发示例
    为【桌面右键菜单
    NPM 模块收集
    nodejs Commander 命令行神器简单示例
    如何用nodejs 开发一个命令行交互工具
    利用 T-sql 的从句 for xml path('') 实现多行合并到一行, 并带有分隔符
  • 原文地址:https://www.cnblogs.com/handongyu/p/8259204.html
Copyright © 2011-2022 走看看