nginx 做前端代理时proxy参数配置
1.后台可登录:
proxy_connect_timeout 300s; proxy_send_timeout 900; proxy_read_timeout 900; proxy_buffer_size 256k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_temp_file_write_size 256k; proxy_max_temp_file_size 1024m; proxy_redirect off; proxy_hide_header Vary; proxy_set_header Accept-Encoding ''; proxy_set_header Host $host; proxy_set_header Referer $http_referer; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_next_upstream http_500 http_502 http_503 http_504 http_404 error timeout invalid_header; #proxy_intercept_errors on; proxy_intercept_errors on; proxy_redirect default; proxy_ignore_client_abort on;
后台不可登录:
proxy_connect_timeout 3s; proxy_send_timeout 9; proxy_read_timeout 9; proxy_buffer_size 32k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_redirect off; proxy_hide_header Vary; proxy_set_header Accept-Encoding ''; proxy_set_header Host $host; proxy_set_header Referer $http_referer; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; #proxy_next_upstream http_502 http_503 http_504 error timeout invalid_header; proxy_intercept_errors on; proxy_redirect default; proxy_ignore_client_abort on; proxy_hide_header "Cache-Control"; proxy_hide_header "Set-Cookie"; proxy_hide_header "Pragma"; proxy_hide_header "X-Powered-By";