3 server_name {{ domain }};
4 location /.well-known/acme-challenge/ {
8 return 301 https://$host$request_uri;
14 server_name {{ domain }};
16 ssl_certificate /certs/live/{{ domain }}/fullchain.pem;
17 ssl_certificate_key /certs/live/{{ domain }}/privkey.pem;
19 # Various TLS hardening settings
20 # https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
21 ssl_protocols TLSv1.2 TLSv1.3;
22 ssl_prefer_server_ciphers on;
23 ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
24 ssl_session_timeout 10m;
25 ssl_session_cache shared:SSL:10m;
26 ssl_session_tickets off;
28 ssl_stapling_verify on;
33 # Enable compression for JS/CSS/HTML bundle, for improved client load times.
34 # It might be nice to compress JSON, but leaving that out to protect against potential
35 # compression+encryption information leak attacks like BREACH.
37 gzip_types text/css application/javascript;
40 # Only connect to this site via HTTPS for the two years
41 add_header Strict-Transport-Security "max-age=63072000";
43 # Various content security headers
44 add_header Referrer-Policy "same-origin";
45 add_header X-Content-Type-Options "nosniff";
46 add_header X-Frame-Options "DENY";
47 add_header X-XSS-Protection "1; mode=block";
50 rewrite (\/(user|u|inbox|post|community|c|login|search|sponsors|communities|modlog|home)+) /static/index.html break;
51 proxy_pass http://0.0.0.0:8536;
52 proxy_set_header X-Real-IP $remote_addr;
53 proxy_set_header Host $host;
54 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
57 proxy_http_version 1.1;
58 proxy_set_header Upgrade $http_upgrade;
59 proxy_set_header Connection "upgrade";