ReverseProxy: Send hostname upstream

fatzopilot nginx-forum at nginx.us
Fri Dec 16 21:52:44 UTC 2011


Hi,

I guess it is rather simple, but I am more of a coder than of an admin
so not an expert in configuring webservers. I'd like to proxy an akamai
proxy which relies on the full hostname being passed (IP is not
enough).

server {
  listen 80;
  server_name proxy.mydomain.com 
##  ssl on;
  location / {
   proxy_pass http://someServer.akamai.com:80;
   proxy_set_header Host $host;
   access_log  /var/log/nginx/upstream.log  upstream;
  }
}
To debug, I configured an upstream log like described here:
http://bethesignal.org/blog/2009/07/22/watching-nginx-upstreams-with-collectd/

It seems, nginx is resolving the upstream host's DNS-Address and uses
the IP in all upstream requests (ommitting the hostname) which is not
enough for the upstream host to answer correctly.

How to forward the upstream hostname (here: someServer.akamai.com) as
well?

Thanks

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



More information about the nginx mailing list