Welcome! Log In Create A New Profile

Advanced

Re: ReverseProxy: Send hostname upstream

Maxim Dounin
December 17, 2011 07:54AM
Hello!

On Fri, Dec 16, 2011 at 04:52:44PM -0500, fatzopilot wrote:

> 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?

Just remove "proxy_set_header Host $host;" from your config.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

ReverseProxy: Send hostname upstream

fatzopilot December 16, 2011 04:52PM

Re: ReverseProxy: Send hostname upstream

Maxim Dounin December 17, 2011 07:54AM

Re: ReverseProxy: Send hostname upstream

fatzopilot December 17, 2011 10:22AM

Re: ReverseProxy: Send hostname upstream

fatzopilot December 17, 2011 10:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready