Welcome! Log In Create A New Profile

Advanced

reverso proxy to different root

Posted by javierch 
reverso proxy to different root
April 21, 2016 02:54AM
Hi
im running nginx/1.6.2 on raspberry pi
i user nginx for owncloud
the root in owncloud file is /var/www

currently i try now to configure trasmission torrent web as a roverse proxy

server {
listen 80;
server_name (my dns name), (my local ipaddress)10.0.0.2;
location /transmission {
proxy_pass http://127.0.0.1:9091;
index index.html
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

but the problem is that nginx takes the root of owncloud and this is why the site of transmission is not found

2016/04/21 09:49:23 [error] 15966#0: *5 open() "/var/www/transmission" failed (2: No such file or directory),

how i should change/add a new root instead that pointing to :/"var/www"?
Thanks
Re: reverso proxy to different root
May 03, 2016 07:19AM
You need to rewrite the request I think

So you are accessing externalhost/transmission

It is hitting backendtarget/transmission

So try this:
location /transmission {
rewrite /transmission(.*) /$1 break;



Edited 1 time(s). Last edit at 05/03/2016 07:20AM by MannyBorges.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready