码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-07-31 19:21:40      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:参数   referer   event   types   生产   byte   min   cgi   配置文件   

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

##--------------------------------------------------------------------------
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;
}
##--------------------------------------------------------------------------

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

标签:参数   referer   event   types   生产   byte   min   cgi   配置文件   

原文地址:http://blog.51cto.com/qiuyt/2152810

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!