# HTTP Server block - responsible for upgrading all http:// traffic to https://www.taxborn.com
server_name taxborn.com www.taxborn.com;
return 301 https://www.taxborn.com$request_uri;
# HTTPS Server block - responsible for handling the SSL certificate
listen 443 quic reuseport;
listen [::]:443 quic reuseport;
server_name taxborn.com www.taxborn.com;
# Add http/3 headers. Move these headers where others are located.
add_header Alt-Svc 'h3=":$server_port"; ma=86400';
ssl_early_data on; # 0-RTT
ssl_certificate /etc/letsencrypt/live/taxborn.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/taxborn.com/privkey.pem;
ssl_session_cache shared:MozSSL:10m; # about 40k sessions
# curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam
ssl_dhparam /etc/nginx/dhparam;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" always;
add_header Content-Security-Policy "frame-ancestors 'none'" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
# intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:E
CDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
# OPTIONAL: I like to enforce the www subdomain
if ($host = taxborn.com) {
return 301 https://www.taxborn.com$request_uri;
proxy_pass http://localhost:4321;
proxy_http_version 1.1; # TODO: how does HTTP/2 perform?
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
access_log /var/log/nginx/taxborn_access.log;
error_log /var/log/nginx/taxborn_error.log;