koegs Posted June 18, 2013 Report Share Posted June 18, 2013 Hi,i just started using btsync and already deployed it on several systems including some "servers".As the btsync config page has not authorization mechanism, i have thought i could use the already installed nginx webserver for that and use it as an reverse proxy:/etc/nginx/sites-enabled/default:... location ~ ^/btsync($|./*) { proxy_pass http://127.0.0.1:8888; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }...Almost the same lines work for other services, but not for btsync, i only get:"invalid request"Any ideas? Quote Link to comment Share on other sites More sharing options...
Disappointed Cat Posted June 18, 2013 Report Share Posted June 18, 2013 There is already a topic about Apache rev. proxy - just for reference.At first glance it's not working because the webUI redirects to /gui and your proxy operates under /btsync. Quote Link to comment Share on other sites More sharing options...
koegs Posted June 18, 2013 Author Report Share Posted June 18, 2013 Good hint!I changed it to "location ~ ^/gui" and it works, maybe with rewrite i can use a different url... Quote Link to comment Share on other sites More sharing options...
AbsolutelyNoOne Posted June 20, 2013 Report Share Posted June 20, 2013 This piece of code works like a charm: location /btsync/ { rewrite ^/btsync/gui(.*) /btsync$1 last; proxy_pass http://127.0.0.1:8888/gui/; proxy_redirect /gui/ /btsync/; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;}(LoL! I was writing a long post criticizing GUI's JS when I suddenly noticed that I wrote the "rewrite" statement with "break" instead of "last".) Quote Link to comment Share on other sites More sharing options...
koegs Posted August 14, 2013 Author Report Share Posted August 14, 2013 With Version 1.1.69 this does not work anymore. Quote Link to comment Share on other sites More sharing options...
AbsolutelyNoOne Posted August 14, 2013 Report Share Posted August 14, 2013 Yeah! I just noticed that.If any btsync developer is reading this... I'd like to ask why there's a Javascript redirection at the root.Doing this way forces me to have another nginx directive to control what is going to /gui/ because nginx only intercepts HTTP redirects...For now, this additional directive helps out, but we will lose the pretty /btsync URL... (we are still able to access /btsync but there will be a redirection to /gui)location /gui/ { proxy_pass http://127.0.0.1:8888/gui/;} Quote Link to comment Share on other sites More sharing options...
nxmehta Posted September 9, 2013 Report Share Posted September 9, 2013 Here's the magic incantation for nginx to get this to work:location /btsync/ { proxy_pass http://localhost:8888/gui/; subs_filter /gui /btsync;}If you understand this config you will see it is a very ugly hack, but that the point we're at right nowĀ Quote Link to comment Share on other sites More sharing options...
Wurlitzer Posted June 2, 2014 Report Share Posted June 2, 2014 Seems to be working again, as of version 1.3.105. Quote Link to comment Share on other sites More sharing options...
Wurlitzer Posted September 28, 2014 Report Share Posted September 28, 2014 Not working anymore. Version 1.4.83. Quote Link to comment Share on other sites More sharing options...
tifred Posted October 8, 2014 Report Share Posted October 8, 2014 Hello all, does the next version will restore the reverse proxy feature? Quote Link to comment Share on other sites More sharing options...
JB09 Posted October 9, 2014 Report Share Posted October 9, 2014 (edited) I believe this is the issue -> http://forum.bittorrent.com/topic/31556-bug-with-fix-webuijs-has-hard-coded-absolute-url/Please fix! Edited October 9, 2014 by JB09 Quote Link to comment Share on other sites More sharing options...
RomanZ Posted October 10, 2014 Report Share Posted October 10, 2014 @JB09I'm checking it out. Please watch the thread you linked to. Quote Link to comment Share on other sites More sharing options...
sea3pea0 Posted June 6, 2016 Report Share Posted June 6, 2016 Here's what I did for apache2: - First I enabled the needed apache2 mods sudo a2enmod proxy_html sudo a2enmod xml2enc - Next I put this in the fileĀ /etc/apache2/sites-available/default-ssl.conf (Replace [PORT] with the btsync port) ProxyPass /btsync http://127.0.0.1:[PORT] ProxyPassReverse /btsync http://127.0.0.1:[PORT] ProxyHTMLInterp On http://127.0.0.1:[PORT] /btsync Redirect permanent /gui /btsync/gui Working for me on apache2 now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.