Help with setting proxy_header

Micheal Wolfskill tdgh2323 at hotmail.com
Sat Mar 24 00:40:06 UTC 2012


Hello!

I have a reverse proxy setup like this...

server {   
......
......

             if ($host = '23.71.33.142' ) { proxy_set_header Host www.domain.com; }
                location / { proxy_pass http://31.186.1.131:60/;  }

}

The problem is that i cannot have a proxy_set_header inside an IF like this. Basically what iam intending to do is.. If the remote client visits my server with the IP (23.71.33.142) as the header (by using http://23.71.33.142) I need to send hardcoded the header to the backend server si my backend server knows it should respond with the content of domain.com .  If they send any other header  then it needs to be past to the backend server to deal with intact (it can be domain.com / www.domain.com / sub.domain.com )

Thanks!

--Mike

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120324/866ca097/attachment.html>


More information about the nginx mailing list