| @@ -0,0 +1,56 @@ | |||
| 1 | + | server { | |
| 2 | + | listen 80; | |
| 3 | + | listen [::]:80; | |
| 4 | + | server_name bit.onni.me; | |
| 5 | + | server_tokens off; | |
| 6 | + | access_log off; | |
| 7 | + | return 301 https://$host$request_uri; | |
| 8 | + | } | |
| 9 | + | server { | |
| 10 | + | # HTTP/2 over TCP | |
| 11 | + | listen 443 ssl; | |
| 12 | + | listen [::]:443 ssl; | |
| 13 | + | # HTTP/3 over QUIC/UDP | |
| 14 | + | listen 443 quic ; | |
| 15 | + | listen [::]:443 quic ; | |
| 16 | + | http2 on; | |
| 17 | + | http3 on; | |
| 18 | + | add_header Alt-Svc 'h3=":443"; ma=86400' always; | |
| 19 | + | server_name bit.onni.me; | |
| 20 | + | server_tokens off; | |
| 21 | + | root /home/www-data/bit.onni.me; | |
| 22 | + | index index.html; | |
| 23 | + | access_log /var/log/nginx/bit.onni.me.log proxy buffer=32k flush=5m if=$loggable; | |
| 24 | + | error_log /var/log/nginx/_error_bit.onni.me.log warn; | |
| 25 | + | include /etc/letsencrypt/options-ssl-nginx.conf; | |
| 26 | + | ssl_certificate /etc/letsencrypt/live/bit.onni.me/fullchain.pem; | |
| 27 | + | ssl_certificate_key /etc/letsencrypt/live/bit.onni.me/privkey.pem; | |
| 28 | + | ssl_dhparam /etc/letsencrypt/dh/chi.pem; | |
| 29 | + | # Security headers | |
| 30 | + | add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; | |
| 31 | + | add_header X-Content-Type-Options "nosniff" always; | |
| 32 | + | add_header X-Frame-Options "SAMEORIGIN" always; | |
| 33 | + | add_header X-XSS-Protection "1; mode=block" always; | |
| 34 | + | add_header X-Robots-Tag "none" always; | |
| 35 | + | add_header X-Download-Options "noopen" always; | |
| 36 | + | add_header X-Permitted-Cross-Domain-Policies "none" always; | |
| 37 | + | add_header Referrer-Policy "strict-origin" always; | |
| 38 | + | add_header Permissions-Policy "interest-cohort=()" always; | |
| 39 | + | # Transmission web UI | |
| 40 | + | location / { | |
| 41 | + | proxy_pass http://127.0.0.1:9091; | |
| 42 | + | include /etc/nginx/_proxy.conf; | |
| 43 | + | } | |
| 44 | + | location = /healthz { | |
| 45 | + | auth_basic off; | |
| 46 | + | proxy_pass http://127.0.0.1:9091/transmission/web/index.html; | |
| 47 | + | proxy_set_header Host $host; | |
| 48 | + | access_log off; | |
| 49 | + | } | |
| 50 | + | # Block hidden files | |
| 51 | + | location ~ /\. { | |
| 52 | + | deny all; | |
| 53 | + | access_log off; | |
| 54 | + | log_not_found off; | |
| 55 | + | } | |
| 56 | + | } | |
meson / [CiCADA] bit.onni.me
Last active 2 weeks ago
meson revised this gist 2 weeks ago · 1916c43
1 file changed, 56 insertions