zukoo
(Zukoo)
June 4, 2015, 1:35am
1
Hello,
Just sharing a little config pretty useful if you want the webui to share the same port as a web site already hosted with Apache:
RewriteRule ^/gui$ /gui/ [R]
ProxyPass /gui/ http://localhost:8080/
<Location /gui/>
ProxyPassReverse http://localhost:8080/
Order Allow,Deny
Allow from All
</Location>
Add this to a *.conf file in conf.d directory of apache and it will redirect all requests on your standard apache port at location gui/ to a syncthing WebUI hosted at localhost:8080 .
This is also useful if you want to reuse your apache configuration such as SSL certificates or authentication.
1 Like
Alex
(Alex)
June 4, 2015, 7:38am
2
Another possibility to get the same is a .htaccess file in a folder of your webroot (for example gui to get the same like in your example)
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{ENV:HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteRule ^(.*) http://localhost:8080/$1 [P]
this also redirects to https to prevent opening the gui unencrypted over the web. I use this method because I can’t change the config of apache on my shared hosting provider
Maybe those methods should be added to the docs that people can easily find that?
2 Likes
It would be awesome if you guys could add these to the documentation repo.
1 Like
zukoo
(Zukoo)
June 6, 2015, 2:25am
5
1 Like
calmh
(Jakob Borg)
June 6, 2015, 7:39am
6
letroll
(Julien Quiévreux)
January 14, 2017, 4:37pm
7
I use configuration from https://docs.syncthing.net/users/reverseproxy.html#folder-configuration on my nginx server. But when I run myadresse . com/syncthing/
my website reload this url : myadresse . com can you help me?
JKing
(J King)
January 14, 2017, 5:21pm
8
Could you post your configuration for the relevant virtual host? I expect there’s another location block taking precedence.
letroll
(Julien Quiévreux)
January 15, 2017, 5:12pm
9
it’s here:
server {
listen 80;
listen 443 ssl;
server_name myurl.fr;
ssl_certificate /etc/letsencrypt/...../...pem;
ssl_certificate_key /etc/letsencrypt/...../....pem;
access_log /var/log/nginx/myurl.log;
error_log /var/log/nginx/myurl.log;
location / {
proxy_pass ...:2369;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 60;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ /.well-known {
allow all;
}
location /transmission {
proxy_pass ...:9090;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
# include Host header
proxy_set_header Host $http_host;
}
location /sickrage {
proxy_pass ....:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /couch {
proxy_pass ....:5050;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /headphone {
proxy_pass ......:8181;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /syncthing/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8384/;
}
location /emby {
proxy_pass ....:8096;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
1 Like