ten-ten-steve
6/20/2013 - 2:38 PM

BTSync / BitTorrent Sync behind nginx

BTSync / BitTorrent Sync behind nginx

# take one

# subdirectory (one server, multiple services)
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;
}

# standalone (one server, one service)
location / {
         proxy_pass http://127.0.0.1:8888/;
         proxy_buffering off;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
}