Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx does not honor X-Forwarded-Proto ?

$
0
0
Hi,

People generally use Nginx as front-end for Apache but my setup is opposite for a specific need:

Client <--------------http/https-------------------> Apache <--------------http-------------------> Nginx

Back-end Nginx gets all requests in plain http and its config is simple:

server {
listen 80;
server_name domain.com;
root /var/www/domain.com;
}

When the client connects using https, Apache is configured to send a X-Forwarded-Proto "https" to Nginx. Now the problem is:

when a ssl URL without a trailing slash is requested:

https://domain.com

Nginx sends the redirect to plain http version with the trailing slash.

http://domain.com/

Shouldn't nginx look at the X-Forwarded-Proto value and redirect appropriately (http to http & https to https)? Read dozens of articles on web in order to seek a proper solution for this but to no avail. I will be really glad if anyone can please help me on this.

Thanks in advance.

-akb

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>