Need help setting nginx up as proxy

merlin corey merlincorey at
Wed Jan 13 03:14:30 MSK 2010

On Tue, Jan 12, 2010 at 4:17 AM, djeyewater <nginx-forum at> wrote:
> Fixed it now - I had copied the proxy syntax from the nginx.conf.default example of proxying to apache, but it seems that the following lines are also needed in the conf for Nginx on port 80, otherwise the Nginx listening on the other port doesn't receive the domain being accessed:
>                        proxy_set_header X-Real-IP $remote_addr;
>                        proxy_set_header Host $host;
>                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> Dave


I think the general assumption is that not every backend cares about
the host header, because you may already be doing host header stuff on
the frontend and the backends might just be listening to a specific
port.  This is why Host and other headers are not passed by default.

-- Merlin

More information about the nginx mailing list