NginX SSL reverse mode, client ip address problem

WANJUNE nginx-forum at
Sun Dec 6 06:14:30 UTC 2015

In NginX reverse mode,

There is a problem that can't get real client's Ip address.

If I use Http protocol, I can simply handle this problem with below http

http {
        server {
        listen 80;
        location / {
            proxy_set_header X-forwarded-for;
            proxy_pass http://destAddress;

The problem is in SSL.

I don't want to use http ssl listen becase of SSL handshaking burden on

I decided to use stream codec like below.

stream {
    upstream aa34 {
        zone first_row 64k;
        server fail_timeout=5s;
    server {
        location / {
            proxy_pass https://aa34;
In this case, I think I can't specify any http related parameters like
Is there any way to change source ip address of TCP/IP Protocol header(Ip
Header) to client's real Ip ?


Posted at Nginx Forum:,263299,263299#msg-263299

More information about the nginx mailing list