Skip to content

Instantly share code, notes, and snippets.

@leetrout
Created February 6, 2020 03:25
Show Gist options
  • Save leetrout/6af3f69a6db2d633b6243f91e06541ce to your computer and use it in GitHub Desktop.
Save leetrout/6af3f69a6db2d633b6243f91e06541ce to your computer and use it in GitHub Desktop.
Reddit Syncthing
version: "3"
services:
nginx:
image: nginx:latest
container_name: nginx-0
networks:
- web
ports:
- "8000:80"
- "8443:443"
restart: always
volumes:
- ./nginx.conf/:/etc/nginx/conf.d/default.conf
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
syncthing:
image: linuxserver/syncthing
container_name: syncthing-0
networks:
- web
- st
ports:
#webUI
- 8384:8384
#listening
- 22000:22000
#port discovery
- 21027:21027/udp
restart: always
volumes:
- ./syncthing/config:/config
- ./syncthing/data:/data
environment:
- TZ=CET
- UMASK_SET=<022>
- PUID=1002
- PGID=999
networks:
web:
st:
server {
listen 80;
server_name sub.example.com;
set $base /var/www;
root $base/sub;
# reverse proxy
location / {
root $base/syncthing;
proxy_set_header Host $host;
proxy_set_header Referer http://syncthing:8384;
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;
rewrite /syncthing/(.*) /$1 break;
proxy_pass http://syncthing:8384/;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment