hi Guys:<div><br></div><div>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. </div><div>We can not set two or more DNS entry, so how to handle such situation? </div>
<div><br></div><div>post my configuration as following:</div><div><br></div><div> server {</div><div> listen 80;</div><div> resolver 8.8.8.8;</div><div><br></div>
<div> location / {</div><div> proxy_pass $scheme://$host$request_uri;</div><div> proxy_set_header Host $http_host;</div><div> proxy_buffer_size 128k;</div>
<div> proxy_buffers 32 32k;</div><div> proxy_busy_buffers_size 128k;</div><div> proxy_buffering off;</div><div> client_max_body_size 1000m;</div>
<div> client_body_buffer_size 256k;</div><div> proxy_connect_timeout 600;</div><div> proxy_read_timeout 600;</div><div> proxy_send_timeout 600;</div>
<div> proxy_temp_file_write_size 128k;</div><div> }</div><div> }</div><div><br></div><div>some error logs were printed out as following;</div><div><br>
</div><div><div>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: "<a href="http://74.125.235.197:80/complete/search?client=chrome&hl=en-US&q=www">http://74.125.235.197:80/complete/search?client=chrome&hl=en-US&q=www</a>.", host: "<a href="http://clients1.google.com">clients1.google.com</a>"</div>
<div>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: "<a href="http://74.125.235.200:80/complete/search?client=chrome&hl=en-US&q=www">http://74.125.235.200:80/complete/search?client=chrome&hl=en-US&q=www</a>.", host: "<a href="http://clients1.google.com">clients1.google.com</a>"</div>
<div>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: "<a href="http://74.125.235.206:80/complete/search?client=chrome&hl=en-US&q=www.g">http://74.125.235.206:80/complete/search?client=chrome&hl=en-US&q=www.g</a>", host: "<a href="http://clients1.google.com">clients1.google.com</a>"</div>
<div>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: "<a href="http://74.125.235.198:80/complete/search?client=chrome&hl=en-US&q=www">http://74.125.235.198:80/complete/search?client=chrome&hl=en-US&q=www</a>.", host: "<a href="http://clients1.google.com">clients1.google.com</a>"</div>
<div>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: "<a href="http://74.125.235.196:80/complete/search?client=chrome&hl=en-US&q=www">http://74.125.235.196:80/complete/search?client=chrome&hl=en-US&q=www</a>.", host: "<a href="http://clients1.google.com">clients1.google.com</a>"</div>
<div>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: "<a href="http://74.125.235.197:80/complete/search?client=chrome&hl=en-US&q=www">http://74.125.235.197:80/complete/search?client=chrome&hl=en-US&q=www</a>.", host: "<a href="http://clients1.google.com">clients1.google.com</a>"</div>
</div><div>~ </div>