Web security headers + HSTS + CSP The article provides a comprehensive technical guide on implementing web security headers, HSTS, and CSP for managing over 130 production client sites on self-managed Linux infrastructure. It emphasizes that security directly impacts SEO performance, as compromised sites lose rankings, trigger browser warnings, and require months of recovery work. The guide includes specific configuration examples for SSL/TLS certificates via Let's Encrypt, Nginx HTTPS setup, and security header implementation to maintain both user trust and search engine ranking. Originally published atPart of ThatDevPro's open SEO + AI framework library. thatdevpro.com . ThatDevPro is an SDVOSB-certified veteran-owned web + AI engineering studio. Open-source AI citation toolkit: github.com/Janady13/aio-surfaces . HTTPS, Headers, Authentication, WAF, Hardening, Incident Response, and the Security Posture Required to Maintain Search Trust A comprehensive reference for web security across the sites Joseph manages. Security is a baseline expectation in 2026 — Google explicitly considers HTTPS a ranking factor modest , security issues trigger manual actions, browser warnings destroy conversion rates, and breach incidents create permanent brand damage. 1. Document Purpose Security is often treated as separate from SEO/marketing concerns, but the disciplines significantly overlap. Hacked sites lose rankings, get flagged in browsers as dangerous, drive away users, generate manual actions in GSC, and require months of recovery work. Sites with poor security signals lose trust both with users and with search engines. For Joseph's specific situation managing 130+ production client sites on self-managed Linux infrastructure, security discipline is foundational. A single compromised client site affects the broader hosting environment. WordPress sites particularly attract attack attempts continuously. This framework specifies security implementation across the full stack — server, application, content, and operational dimensions. 1.1 Required Tools - SSL Labs — ssllabs.com/ssltest/ — SSL/TLS configuration testing - Mozilla Observatory — observatory.mozilla.org — security headers analysis - Security Headers — securityheaders.com — header analysis - WPScan — WordPress vulnerability scanner - OWASP ZAP — application security scanner - Wordfence / Sucuri / Patchstack — WordPress security platforms - Cloudflare — WAF and DDoS protection - Let's Encrypt / acme.sh — free SSL certificates 2. HTTPS Implementation 2.1 SSL Certificate Management ssl certificate management: certificate options: lets encrypt: cost: "Free" validity: "90 days auto-renew " best for: "Most sites; commodity SSL" automation: "Certbot, acme.sh" paid dv certificates: cost: "$10-100/year" validity: "1-2 years" best for: "Sites preferring longer validity" benefit: "Sometimes faster issuance" extended validation: cost: "$100-500+/year" validity: "1-2 years" best for: "Financial, e-commerce with high trust requirements" note: "Browser address bar treatment reduced; less differentiation than years past" multi domain strategies: san certificates: description: "Multiple domains in single certificate" use case: "Multiple related domains" wildcard certificates: description: "Covers .example.com subdomains" use case: "Many subdomains" note: "Doesn't cover apex; need separate or SAN with apex" multi san: description: "Multiple unrelated domains in one certificate" use case: "Convenience; fewer certificates to manage" 2.2 Let's Encrypt Implementation For Joseph's Debian/Nginx setup managing 130+ sites: Install certbot apt install certbot python3-certbot-nginx Get certificate for single site certbot --nginx -d example.com -d www.example.com Auto-renewal typically configured by certbot install systemctl status certbot.timer Manual renewal test certbot renew --dry-run For mass renewal management: Renew all certificates certbot renew --quiet Should be in cron or systemd timer Default: twice daily check, renews when within 30 days of expiry 2.3 Nginx HTTPS Configuration Strong default Nginx HTTPS configuration: server { listen 443 ssl http2; listen :: :443 ssl http2; server name example.com www.example.com; SSL Certificate ssl certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl certificate key /etc/letsencrypt/live/example.com/privkey.pem; Modern SSL 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:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384'; ssl prefer server ciphers off; ssl session cache shared:SSL:10m; ssl session timeout 10m; OCSP Stapling ssl stapling on; ssl stapling verify on; ssl trusted certificate /etc/letsencrypt/live/example.com/chain.pem; resolver 1.1.1.1 8.8.8.8 valid=300s; Security Headers see Section 3 add header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; ... rest of configuration } Redirect HTTP to HTTPS server { listen 80; listen :: :80; server name example.com www.example.com; return 301 https://$host$request uri; } 2.4 SSL Testing After implementation, verify with SSL Labs ssllabs.com/ssltest/ : - Target: A or A+ grade - Issues to fix: protocol weaknesses, weak ciphers, missing OCSP, certificate chain issues 3. Security Headers Security headers add layers of browser-enforced protection. 3.1 Complete Security Headers Strict-Transport-Security HSTS Forces HTTPS, prevents downgrade attacks add header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; X-Frame-Options Prevents clickjacking via iframe embedding add header X-Frame-Options "SAMEORIGIN" always; X-Content-Type-Options Prevents MIME sniffing add header X-Content-Type-Options "nosniff" always; Referrer-Policy Controls referrer information sent add header Referrer-Policy "strict-origin-when-cross-origin" always; Permissions-Policy formerly Feature-Policy Controls browser features add header Permissions-Policy "geolocation= , microphone= , camera= " always; Content-Security-Policy most complex; see below add header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https://www.google-analytics.com; frame-ancestors 'self'; base-uri 'self'; form-action 'self';" always; Cross-Origin policies add header Cross-Origin-Opener-Policy "same-origin" always; add header Cross-Origin-Resource-Policy "same-origin" always; add header Cross-Origin-Embedder-Policy "require-corp" always; 3.2 Content Security Policy CSP CSP is the most complex but most powerful header. It defines what sources of scripts, styles, images, etc. are allowed: csp directives: default src: purpose: "Fallback for other directives" typical: "'self'" script src: purpose: "Allowed JavaScript sources" common additions: - "'self'" - "https://www.googletagmanager.com" - "https://www.google-analytics.com" - "'unsafe-inline'" Often required; reduces protection avoid: "'unsafe-eval' unless absolutely required" style src: purpose: "Allowed CSS sources" common: "'self' 'unsafe-inline' https://fonts.googleapis.com" img src: purpose: "Allowed image sources" common: "'self' data: https:" font src: purpose: "Allowed font sources" common: "'self' https://fonts.gstatic.com" connect src: purpose: "Allowed fetch/XHR destinations" common: "'self' https://www.google-analytics.com" frame ancestors: purpose: "Who can iframe this page" typical: "'self'" note: "Replaces X-Frame-Options" base uri: purpose: "Restrict