38 lines
1.4 KiB
Text
38 lines
1.4 KiB
Text
# SSL/HTTPS Server Block Template
|
|
# This file is used as a template when SSL certificates are available
|
|
# The domain placeholder __DOMAIN__ will be replaced with the actual domain
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name __DOMAIN__;
|
|
|
|
# SSL Certificate paths (Let's Encrypt)
|
|
ssl_certificate /etc/letsencrypt/live/__DOMAIN__/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/__DOMAIN__/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 settings
|
|
ssl_session_timeout 1d;
|
|
ssl_session_cache shared:SSL:50m;
|
|
ssl_session_tickets off;
|
|
|
|
# OCSP Stapling
|
|
ssl_stapling on;
|
|
ssl_stapling_verify on;
|
|
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
|
resolver_timeout 5s;
|
|
|
|
# Security headers
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
|
|
# Include the main location blocks
|
|
# These should match your HTTP server configuration
|
|
include /usr/local/openresty/nginx/conf/locations.conf;
|
|
}
|