On Sat, Mar 24, 2012 at 12:40:06AM +0000, Micheal Wolfskill wrote:
Hi there,
> if ($host = '23.71.33.142' ) { proxy_set_header Host www.domain.com; }
> location / { proxy_pass http://31.186.1.131:60/; }
You want to have
proxy_set_header Host $host;
unless $host is this IP address, in which case you want a different value?
set $myhost $host;
if ($host = '23.71.33.142') { set $myhost www.domain.com; }
proxy_set_header Host $myhost;
where the first two are at server{} level, and the last is at server{}
or location{} level.
Using the "map" directive is another way of setting your $myhost variable.
f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx