Welcome! Log In Create A New Profile

Advanced

Nginx seems to ignore proxy_set_header Host directive

February 11, 2013 10:44AM
Hi all

I am trying to use nginx to get remote access to various service on my home server, via proxy_pass redirection to various subdirectorys

For example, owncloud server with apache, pyload with it's builtin http server, xbmc web interface, ...

I access the webserver via a static IP adress, and not via a domain name.

Here's a simple conf file for nginx.


########################################################
server {
listen 80; ## listen for ipv4; this line is default and implied

root /hdd/www;
index index.html index.htm;

server_name localhost;

location /pyload/ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://192.168.1.100:8001/;
}
}
########################################################

I think this setup would be straighforward, but for some reason, all relative path are not rewriten and I get 502 error for all images, css and js file.

I would be very grateful if someone had a clue to help me understanding what I am doing wrong.

Regards
Subject Author Posted

Nginx seems to ignore proxy_set_header Host directive

jeangouytch February 11, 2013 10:44AM

Re: Nginx seems to ignore proxy_set_header Host directive

Francis Daly February 11, 2013 02:10PM

Re: Nginx seems to ignore proxy_set_header Host directive

jeangouytch February 11, 2013 04:13PM

Re: Nginx seems to ignore proxy_set_header Host directive

Francis Daly February 11, 2013 04:44PM

Re: Nginx seems to ignore proxy_set_header Host directive

jeangouytch February 12, 2013 02:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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