how to use $host variable in proxy_pass

hirenshah.05 nginx-forum at nginx.us
Wed Dec 28 19:42:40 UTC 2011


I tried this,

server {
listen 80;
server_name "";

location / {
resolver 127.0.0.1;

proxy_pass https://$host; //gives error. And $host value is same like
above hostname "cds.hh.net"
proxy_redirect off;
}

}

but still not working. If I check error log it says,

375#0: recv() failed (111: Connection refused) while resolving,
resolver: 127.0.0.1:53



Thanks for your help.


Hiren

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220619,220627#msg-220627



More information about the nginx mailing list