Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

However, since Stunnel is a proxy an has no knowledge of HTTP, the client's IP address was lost, which is somewhat annoying.

Try ngx_http_realip_module and X-Forwarded-For support for Stunnel:

set_real_ip_from   192.168.2.1;
real_ip_header     X-Forwarded-For;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.