Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ssl_session_cache shared:ssl_session_cache:10m; # For increased performance, allow some session re-using
- # Redirect every http call to https, basically disallowing direct http access to anything.
- server {
- listen 80; # Listen on port 80 IPv4
- listen [::]:80; # Listen on port 80 IPv6
- #server_name example.com; #defaulting for all
- return 301 https://$host$request_uri; # Try again with https
- }
- server {
- # Other nginx stuff not concerning syncthing is placed here
- server_name example.com #your hostname here
- ...
- ...
- ...
- }
- # https-reverse-proxy for syncthing
- server {
- listen 443 ssl http2; # Listen on port IPv4; port 443; use SSL/TLS; use http/2 if supported by client;
- listen [::]:443 ssl http2; # Same as above, but for IPv6
- server_name syncthing.example.com; #place your hostname here
- ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem; # Path to let's encrypt certificates
- ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
- # Ensure adequate TLS cipher suites are used - taken from Mozilla recommended configurations, see here: https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
- ssl_prefer_server_ciphers on;
- location / {
- # Forward some required and/or recommended headers
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # For better performance reasons when transferring large data behind a reverse proxy. Probably not neccessary for syncthing.
- proxy_buffers 32 4m;
- proxy_busy_buffers_size 25m;
- proxy_buffer_size 512k;
- proxy_max_temp_file_size 0;
- proxy_pass http://localhost:8384/; # Assuming syncthing GUI is running on localhost port 8384
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement