nginx: server_name and server_addr wrong with reverse proxy in front of it

Posted by user41356 on Server Fault See other posts from Server Fault or by user41356
Published on 2011-02-21T04:33:50Z Indexed on 2011/02/21 7:26 UTC
Read the original article Hit count: 495

Filed under:
|
|
|

I have stunnel in front of nginx in order to handle ssl. (I'm aware that nginx can handle ssl, but I'm migrating off nginx and this is a necessary step.)

Stunnel and nginx are running on the same box.

Without stunnel in front of nginx, nginx got the server_addr and server_name as the public ip of the box and the domain of the url I was fetching, respectively.

Now with stunnel, nginx thinks the server_addr and server_name are 127.0.0.1 and localhost respectively. This is screwing up a bunch of things.

How can I make nginx get (or stunnel send) the correct server_addr and server_name?

© Server Fault or respective owner

Related posts about nginx

Related posts about http