Version: nginx/1.2.0 || (I know the risks, its for a internal server) How would I setup a system where 17.hostname.com would be put as proxy_pass http://192.168.56.17:80 (Where 17 would be replaced with what ever number was before the hostname)
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
|
|||
|
Edit: The regular expression server_name and map directive solutions are better than this one, which uses the evil if directive. The $host variable contains the hostname which the client requested, although you need to process this a bit to just get the part you want. It looks like the only way to achieve this is with the if and set directives from the Rewrite module, so try something like this:
|
|||||||||
|
And remember: If is evil !!! ;-) |
||||
|
|
|
|||
|
|
if. See either serverfault.com/a/388660/67675 or serverfault.com/a/388709/67675 – poige May 13 '12 at 19:06