No Upstream Proxy Headers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

No Upstream Proxy Headers

Kilian Ries

Hello,

 

i'm running a nginx (version: nginx/1.13.1) with two vhosts with exact the same configuration. The only difference is the upstream section: each vhosts points to a different upstream server / ip.

 

My configuration looks like this:

 

###

...

location / {

            proxy_pass http://IP_ADDRESS;

            proxy_set_header Host                   $host;

            proxy_set_header X-Real-IP       $proxy_protocol_addr;

            proxy_set_header X-Forwarded-For $proxy_protocol_addr;

}

...

###

 

vhost_1 works without any problem and i can see both proxy_headers in the tcpdump and in my upstream-apache access-logs.

 

vhost_2 doesn't show me any x-forwarded headers, whether in the upstream-apache nor in the tcpdump (which is running locally on my nignx host). So it looks like when apache doesn't attach the upstream_headers to the HTTP request. 

 

Additionally i can see via tcpdump that HTTP protocol (get request) to vhost_2 (borken) is 1.0 and to vhost_1 (working) is 1.1; However, both responses are 1.1 so both upstream-apaches are capable of HTTP 1.1.

 

Does somebody know why my nginx is sending its HTTP request to vhost_2 via HTTP 1.0 and not 1.1? And if, could that be that HTTP 1.0 is not working with proxy_set_header?

 

Thats the only difference im seeing in my setup / tcpdump ... could there be any other difference why nginx is not attaching the upstream headers to my vhost_2?

 

Thanks

Greets

Kilian


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: No Upstream Proxy Headers

Francis Daly
On Mon, Sep 04, 2017 at 08:46:48PM +0000, Kilian Ries wrote:

Hi there,

> i'm running a nginx (version: nginx/1.13.1) with two vhosts with exact the same configuration. The only difference is the upstream section: each vhosts points to a different upstream server / ip.
>

"nginx -T" will show the full configuration used.

That might help show other differences in the running configs.

>             proxy_set_header X-Real-IP       $proxy_protocol_addr;
>             proxy_set_header X-Forwarded-For $proxy_protocol_addr;

> vhost_1 works without any problem and i can see both proxy_headers in the tcpdump and in my upstream-apache access-logs.

"Normal" web clients don't speak the proxy protocol.

Can you describe a complete test case that someone else can use to see
the problem you see?

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx