Last active
November 15, 2018 13:44
-
-
Save Shmarkus/49b7a4265a389d88ea9ff1c80639d0bc to your computer and use it in GitHub Desktop.
NGINX HTTP/2 conf template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name ${NGINX_SERVER_NAME}; | |
server_tokens off; | |
# Use 302 (moved temporarly) to reduce headaches | |
return 302 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
server_name ${NGINX_SERVER_NAME}; | |
server_tokens off; | |
ssl_certificate /etc/ssl/certs/cert.crt; | |
ssl_certificate_key /etc/ssl/private/cert.key; | |
ssl_session_timeout 5m; | |
# Keep an eye out for web server hardening tips and change when necessary | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA HIGH !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"; | |
ssl_prefer_server_ciphers on; | |
client_max_body_size 10M; | |
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; | |
add_header X-Frame-Options "DENY"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment