Nginx + SSL Setup for Static Sites on VPS: Complete Guide

Nginx is a web server that proxies requests and serves static files. For a static site on GitHub CMS, it operates in its simplest mode: accepts HTTPS requests, verifies the SSL certificate, and returns a pre-built HTML file from disk. No PHP, no database, no FastCGI. TTFB ≤200ms is achieved precisely through this simplicity — nginx doesn't compute the page, it just serves it.

Nginx SSL Setup

SSL via Let's Encrypt: 4 Commands

1

Install certbot

apt install certbot python3-certbot-nginx

2

Get certificate

certbot --nginx -d example.com

3

Auto-renewal

Certbot renews automatically every 60 days.

4

Verify

SSL Labs: A+ rating for nginx with proper configuration.

Let's Encrypt SSL

CSP and HSTS: Security at the HTTP Header Level

HeaderPurpose
HSTSForces HTTPS-only for 2 years
CSPRestricts script and style sources
X-Frame-OptionsBlocks iframe embedding
X-Content-TypeBlocks MIME type sniffing

FAQ

How often do I need to renew SSL?

Certbot auto-renews Let's Encrypt certificates 30 days before expiry. No manual action needed. Certificate lifetime is 90 days.

Set Up nginx + SSL in 30 Minutes

GitHub CMS Pro includes a ready nginx.conf and auto-deploy to VPS. VPS from $4/mo.