Last active
April 11, 2016 18:17
-
-
Save katopz/0942b530212f81c3a8b0a9dc57a05d89 to your computer and use it in GitHub Desktop.
HTTP2+SSL // sudo nano /etc/nginx/conf.d/default.conf
This file contains hidden or 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 443 ssl http2; | |
server_name rabbot.io www.rabbot.io; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; | |
ssl_prefer_server_ciphers on; | |
ssl_certificate /etc/letsencrypt/live/rabbot.io/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/rabbot.io/privkey.pem; | |
ssl_session_cache shared:SSL:128m; | |
add_header Strict-Transport-Security "max-age=31557600; includeSubDomains"; | |
add_header X-Frame-Options "SAMEORIGIN" always; | |
add_header X-Content-Type-Options "nosniff" always; | |
add_header X-Xss-Protection "1"; | |
add_header Content-Security-Policy "default-src 'self'; script-src 'self' *.google-analytics.com"; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
# Your favorite resolver may be used instead of the Google one below | |
resolver 8.8.8.8; | |
root /var/www/demo; | |
index index.html; | |
location '/.well-known/acme-challenge' { | |
root /var/www/demo; | |
} | |
location / { | |
if ($scheme = http) { | |
return 301 https://$server_name$request_uri; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment