Welcome! Log In Create A New Profile

Advanced

Proxy with SSL offload and Nginx redirections

Artur
January 24, 2019 06:04PM
Hello,

In my setup I have a proxy with TLS offload with Nginx as a backend
server (without TLS).

If client asks an url such as https://host/dir, the proxy relays the
request to Nginx as follows : http://host/dir
Nothing strange here, this is an usual behaviour.
Then Nginx sees that there is trailing slash missing and returns a 301
redirect with following location : http://host/dir/
This behaviour is certainly related to the following directive :
try_files $uri $uri/ =404;

I'd prefer that Nginx returns a 301 redirect with tls enabled :
https://host/dir/

I've currently configured the proxy to set header
X-Forwarded-Proto:https but it does not change anything.

Could you please point me to the right directive so Nginx follows what
is set in X-Forwarded-Proto header ?
Maybe I should use 'absolute_redirect off;' ?

--

Best regards,
Artur.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy with SSL offload and Nginx redirections

Artur January 24, 2019 06:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
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