nginx+webpy 出现 upstream timed out
关于nginx配置webpy应用出现的错误
upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.6.141, server: localhost, request: "POST /api/ HTTP/1.1", upstream:
解决方法:
在你的nginx主配置文件中的server下配置以下内容,如果你的nginx后面是proxy,就设置proxy相关的配置,如果是fastcgi就设置fastcgi相关的配置。我们目前配置的是webpy应用,所以配置fastcgi相关即可。
large_client_header_buffers 4 16k; client_max_body_size 30m; client_body_buffer_size 128k; #proxy_connect_timeout 300; #proxy_read_timeout 300; #proxy_send_timeout 300; #proxy_buffer_size 64k; #proxy_buffers 4 32k; #proxy_busy_buffers_size 64k; #proxy_temp_file_write_size 64k; fastcgi_connect_timeout 300; fastcgi_read_timeout 300; fastcgi_send_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 32k; fastcgi_busy_buffers_size 64k; fastcgi_temp_file_write_size 64k;
重新reload一下你的nginx配置即可正常访问。