Welcome! Log In Create A New Profile

Advanced

Proxy_protocol, how to check protocol or port (not only remote IP)

Posted by semseoymas 
Proxy_protocol, how to check protocol or port (not only remote IP)
May 27, 2014 06:54AM
Hello:

I am using proxy_protocol at Nginx along with TCP/TCP-SSL ELB at AWS.

Client address specified in the PROXY protocol header is now saved in the $proxy_protocol_addr variable and can be used in the realip module. That is great.

But programmers use to check connection along with php variable $_SERVER["HTTP_X_FORWARDED_PORT"].

ELB proxy_protocol is sending this information inside the headers... I can look for it at headers using tcpdump:

...x..PD .....2P.9..W..PROXY TCP4 77.224.111.207 192.168.10.182 51449 443

At the end, you may see proxy_protocol is sending out this port information.

Is nginx suppossed to include this port information into a proxy_protocol_* variable?

I really need to know what is the original Port used at PHP... I have had a look at google/nginx and I think developers did include only the remote IP, but not the port.

Any ideas?

Thanks so much.
Re: Proxy_protocol, how to check protocol or port (not only remote IP)
October 15, 2014 09:39AM
Can Somebody please shed some light on it. We are really in need of all the details of proxy protocol values.
Re: Proxy_protocol, how to check protocol or port (not only remote IP)
November 04, 2014 04:39PM
I have the very same question. Any help would be much appreciated.
Re: Proxy_protocol, how to check protocol or port (not only remote IP)
November 05, 2014 03:41AM
For logging you have $remote_addr:$remote_port, can't you pass $remote_port ?

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Proxy_protocol, how to check protocol or port (not only remote IP)
July 29, 2015 05:59AM
I am having the same problem - I need to detect if the connection is using SSL or not.

I used to use

if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; }

but now I switched to proxy_protocol and I'm not seeing a way to detect if SSL is being used. It seems there should be a $proxy_prototcol_proto and/or $proxy_prototcol_port variables but they don't seem to exist.
Re: Proxy_protocol, how to check protocol or port (not only remote IP)
July 29, 2015 08:31AM
dgobaud Wrote:
-------------------------------------------------------
> I am having the same problem - I need to detect if the connection is
> using SSL or not.

$scheme

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready