hi Guys:
When I run NGINX as a proxy and set a resolver(such as 8.8.8.8), I
found
out if DNS fail to resolve, 502 is popped up.
We can not set two or more DNS entry, so how to handle such situation?
post my configuration as following:
server {
listen 80;
resolver 8.8.8.8;
location / {
proxy_pass $scheme://$host$request_uri;
proxy_set_header Host $http_host;
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
proxy_buffering off;
client_max_body_size 1000m;
client_body_buffer_size 256k;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_temp_file_write_size 128k;
}
}
some error logs were printed out as following;
2012/08/11 10:43:20 [error] 13297#0: *183 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
192.168.52.8, server: , request: “GET
/complete/search?client=chrome&hl=en-US&q=www. HTTP/1.1”, upstream: "
http://74.125.235.197:80/complete/search?client=chrome&hl=en-US&q=www.“,
host: “clients1.google.com”
2012/08/11 10:43:21 [error] 13297#0: *191 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
192.168.52.8, server: , request: “GET
/complete/search?client=chrome&hl=en-US&q=www. HTTP/1.1”, upstream: "
http://74.125.235.200:80/complete/search?client=chrome&hl=en-US&q=www.”,
host: “clients1.google.com”
2012/08/11 10:43:21 [error] 13297#0: *196 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
192.168.52.8, server: , request: “GET
/complete/search?client=chrome&hl=en-US&q=www.g HTTP/1.1”, upstream: "
http://74.125.235.206:80/complete/search?client=chrome&hl=en-US&q=www.g",
host: “clients1.google.com”
2012/08/11 10:43:21 [error] 13297#0: *183 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
192.168.52.8, server: , request: “GET
/complete/search?client=chrome&hl=en-US&q=www. HTTP/1.1”, upstream: "
http://74.125.235.198:80/complete/search?client=chrome&hl=en-US&q=www.“,
host: “clients1.google.com”
2012/08/11 10:43:21 [error] 13297#0: *191 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
192.168.52.8, server: , request: “GET
/complete/search?client=chrome&hl=en-US&q=www. HTTP/1.1”, upstream: "
http://74.125.235.196:80/complete/search?client=chrome&hl=en-US&q=www.”,
host: “clients1.google.com”
2012/08/11 10:43:21 [error] 13297#0: *191 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
192.168.52.8, server: , request: “GET
/complete/search?client=chrome&hl=en-US&q=www. HTTP/1.1”, upstream: "
http://74.125.235.197:80/complete/search?client=chrome&hl=en-US&q=www.",
host: “clients1.google.com”
~