LNMP Nginx 499 问题 第三方回调异常

nginx生产配置文件参考 解决http 499 问题,解决银联回调 异常,每次请求第一次失败,第二次成功,每次都要等三分钟,主要添加参数是优化buffer\cache,还有超时时间,

问题排查步骤:

1,查看DNS 【服务器本地DNS、局域网bindDNS,CDN解析,域名映射,NAT等】
2,查看nginx 连接状态,TCP11种状态,是否存在主动丢弃连接
3,查看nginx配置 是否存在优化项,特呗注意 timeout、ignore_client_abort,fastcgi端口跳转等等

##--------------------------------------------------------------------------
user  www www;
worker_processes 4;
error_log  /home/logs/nginx_error.log notice;
pid        /var/run/nginx.pid;
worker_rlimit_nofile 6553;

##--------------------------------------------------------------------------
events {
        use epoll;
        worker_connections 5120;
        multi_accept on;
    }
##--------------------------------------------------------------------------
http {
        include       mime.types;
#include       secure/limit_zone.conf;
        default_type  application/octet-stream;

        server_tokens off;
        server_names_hash_bucket_size 128;
        client_header_buffer_size 512k;
        client_body_buffer_size 1024k;
        large_client_header_buffers 4 32k;
        client_max_body_size 50m;
        sendfile   on;
        tcp_nopush on;
        keepalive_timeout 300;
        tcp_nodelay on;
##--------------------------------------------------------------------------
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_ignore_client_abort on;
        fastcgi_buffer_size 512k;
        fastcgi_buffers 6 512k;
        fastcgi_busy_buffers_size 512k;
        fastcgi_temp_file_write_size 512k;
        fastcgi_next_upstream error timeout invalid_header http_500 http_503 http_403;
##--------------------------------------------------------------------------
        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 4;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
       gzip_disable   "MSIE [1-6]\.";
       proxy_connect_timeout    3;
    proxy_read_timeout       60;
    proxy_send_timeout       60;
###--------------------------------------------------------------------------
        log_format main '$remote_addr - $remote_user [$time_local] "$request"'
             '$status $body_bytes_sent "$http_referer"'
             '"$http_user_agent" "$http_x_forwarded_for"';
##--------------------------------------------------------------------------
upstream myfastcgi {
                ip_hash;
                server 192.168.0.32:9000  weight=1;
}
##--------------------------------------------------------------------------
include       vhost/*.conf;
    log_format json '{ "@timestamp": "$time_local", '
         '"@fields": { '
         '"remote_addr": "$remote_addr", '
         '"remote_user": "$remote_user", '
         '"body_bytes_sent": "$body_bytes_sent", '
         '"request_time": "$request_time", '
         '"status": "$status", '
         '"request": "$request", '
         '"request_method": "$request_method", '
         '"http_referrer": "$http_referer", '
         '"body_bytes_sent":"$body_bytes_sent", '
         '"http_x_forwarded_for": "$http_x_forwarded_for", '
         '"http_user_agent": "$http_user_agent" } }';
    access_log  /var/log/nginx/access_json.log  json;
}
##--------------------------------------------------------------------------

转载于:https://blog.51cto.com/qiuyt/2152810

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值