Proxy_pass error: host not found in upstream

config file:
server {
listen [::]:80;
server_name svn.php.net;
location /{
proxy_pass http://svn.php.net;
}
}
server {
listen [::]:80;
server_name upload.wikipedia.org;
location /{
proxy_pass http://upload.wikipedia.org;
}
}

/usr/sbin/nginx -t

[emerg]: host not found in upstream “upload.wikipedia.org” in
/etc/nginx/sites-enabled/blocked-reverse-proxy:12
configuration file /etc/nginx/nginx.conf test failed

I set the similar server block for reverse proxying svn.php.net and
upload.wikipedia.org , while svn.php.net passed the config test but
upload.wikipedia.org NOT. Why?

/usr/sbin/nginx -V

nginx version: nginx/0.7.64
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf
–error-log-path=/var/log/nginx/error.log
–pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock
–http-log-path=/var/log/nginx/access.log
–http-client-body-temp-path=/var/lib/nginx/body
–http-proxy-temp-path=/var/lib/nginx/proxy
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
–with-http_stub_status_module --with-http_flv_module
–with-http_ssl_module --with-http_dav_module
–with-http_gzip_static_module --with-mail --with-mail_ssl_module
–with-ipv6
–add-module=/tmp/buildd/nginx-0.7.64/modules/nginx-upstream-fair

It’s the debian package.


Ren Xiaolei

On Mon, May 10, 2010 at 5:15 PM, Igor S. [email protected] wrote:

Host upload.wikipedia.org not found: 3(NXDOMAIN)
Thank you for pointing out my mistake.
But I wonder why is the domain name resolved when testing config file?
I think NXDOMAIN should be a runtime error, not occured before nginx
runs. Or else, what would happen if the domain name is deleted during
nginx running?


Ren Xiaolei

On Mon, May 10, 2010 at 05:08:34PM +0800, 任晓磊 wrote:

    server_name upload.wikipedia.org;

I set the similar server block for reverse proxying svn.php.net and
upload.wikipedia.org , while svn.php.net passed the config test but
upload.wikipedia.org NOT. Why?

host upload.wikipedia.org
Host upload.wikipedia.org not found: 3(NXDOMAIN)


Igor S.
http://sysoev.ru/en/

On Mon, May 10, 2010 at 08:46:53PM +0800, 任晓磊 wrote:

On Mon, May 10, 2010 at 5:15 PM, Igor S. [email protected] wrote:

Host upload.wikipedia.org not found: 3(NXDOMAIN)
Thank you for pointing out my mistake.
But I wonder why is the domain name resolved when testing config file?
I think NXDOMAIN should be a runtime error, not occured before nginx
runs. Or else, what would happen if the domain name is deleted during
nginx running?

nginx resolves hosts at configuration phase, because for a long time
nginx has no non-blocikng resolver. Currently it has, but resolves
hosts at run-time only if proxy_pass contains variables in any place,
not necessarily in the host part.


Igor S.
http://sysoev.ru/en/

On Mon, May 10, 2010 at 9:04 PM, Igor S. [email protected] wrote:

nginx resolves hosts at configuration phase, because for a long time
nginx has no non-blocikng resolver. Currently it has, but resolves
hosts at run-time only if proxy_pass contains variables in any place,
not necessarily in the host part.

It’s difficult to communicate with you if I insist my old version.
I will update my version as soon as possible.


Ren Xiaolei