Set various proxy headers in nginx config

These headers are required for apps like wordpress to figure the
site url. It is not clear why they do not just use relative urls.

http://cmanios.wordpress.com/2014/04/12/nginx-https-reverse-proxy-to-wordpress-with-apache-http-and-different-port/
This commit is contained in:
Girish Ramakrishnan
2014-08-10 22:30:54 -07:00
parent 4ec9e6d3ca
commit af400a038e
+10
View File
@@ -17,6 +17,16 @@ server {
}
location / {
proxy_pass http://127.0.0.1:<%= port %>;
proxy_read_timeout 3500;
proxy_connect_timeout 3250;
proxy_set_header Host $host;
proxy_set_header X-Originating-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
}
}