nginx----配置优化

错误页面优化

server {
        listen 8001;
        server_name localhost;
        error_page 500 /500.html;
        error_page 502 /502.html;
        error_page 503 /503.html;
        error_page 504 /504.html;
        error_page 403 /403.html;
        error_page 404 /404.html;

location / {
        root html/www;
        index index.php index.html index.htm;
    }
}

499错误优化

问题描述

499 CLIENT CLOSED REQUESTA

non-standard status code introduced by nginx for the case when a client closes the connection while nginx is processing the request.

原因

服务器返回http头之前,客户端就提前关闭了http连接,常见于后台接口处理时间比较长,而前端请求又自带有超时时间。

解决方法

添加配置

proxy_ignore_client_abort on;          #不主动断开客户端的连接

原文地址:https://www.cnblogs.com/QicongLiang/p/9838225.html