About resolver and 502 error

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
~

On Mon, Aug 13, 2012 at 05:20:40PM +0800, Geoge.Q wrote:

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 suchsituation?

To answer this specific question: upgrade. Recent versions of nginx
(1.1.7+,
1.2.x, 1.3.x) support multiple resolvers.

http://nginx.org/r/resolver

It is a great chance for all the pc game fans for that the Guild Wars 2
is coming on the way! We could freely enjoy the game after it is
released on August 28. Now, I have found a good place
tobuy guild wars 2 gold,
the gw2 gold in this store is cheaper than any
othergw2 gold store. If
youwant to buy cheap guild wars 2 gold. I think it is an idea choice! I
ama old fan for guild wars and I do hopely the guild wars 2 can
comesoon!

Posted at Nginx Forum:

thanks Ruslan, it works now :slight_smile: