Skip to content

fix(nginx): add Strict-Transport-Security header for HTTPS deployments#177

Open
andrerfneves wants to merge 1 commit into
mainfrom
maintenance/fix-nginx-hsts-20260613
Open

fix(nginx): add Strict-Transport-Security header for HTTPS deployments#177
andrerfneves wants to merge 1 commit into
mainfrom
maintenance/fix-nginx-hsts-20260613

Conversation

@andrerfneves

Copy link
Copy Markdown
Owner

Summary

Adds the Strict-Transport-Security (HSTS) header to the nginx configuration to enforce HTTPS connections in production deployments.

Changes

  • nginx.conf: Added add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; to the security headers block

Why

The nginx config already sets several security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy) but was missing HSTS. This header tells browsers to always connect via HTTPS after the first visit, helping protect against protocol downgrade attacks and cookie hijacking.

Impact

  • Adds a 1-year (31536000s) max-age with includeSubDomains
  • Safe for the existing Docker deployment pattern (TLS termination at reverse proxy)
  • No behavior change for development/localhost usage (browsers ignore HSTS on localhost)

Test Plan

  • nginx config syntax is valid (no syntax errors in the one-line addition)
  • Existing Docker deployment continues to work unchanged
  • Build passes

Add HSTS header with a 1-year max-age and includeSubDomains flag to
improve security for production deployments. This ensures browsers
will always connect via HTTPS after the first visit.

The existing security headers (X-Frame-Options, X-Content-Type-Options,
X-XSS-Protection, Referrer-Policy) are preserved.
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lightning-decoder Ready Ready Preview, Comment Jun 13, 2026 8:03am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant