Last active
August 29, 2015 14:23
-
-
Save efouts/a145cdb8f511b81c2d11 to your computer and use it in GitHub Desktop.
nginx proxy example
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_tokens off; | |
add_header X-Frame-Options SAMEORIGIN; | |
add_header X-Content-Type-Options nosniff; | |
server { | |
listen 443 ssl default deferred; | |
server_name example.com; | |
ssl_certificate /etc/ssl/private/example_com.crt; | |
ssl_certificate_key /etc/ssl/private/example_com.key; | |
ssl_protocols TLSv1.2; | |
ssl_session_cache shared:SSL:10m; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL; | |
ssl_dhparam /etc/ssl/certs/dhparam.pem; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
resolver 8.8.8.8 8.8.4.4 valid=300s; | |
resolver_timeout 5s; | |
add_header Strict-Transport-Security max-age=31536000; | |
location / { | |
proxy_set_header HOST $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass http://localhost:8000; | |
proxy_read_timeout 90; | |
proxy_redirect http://localhost:8000 https://example.com; | |
} | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
return 301 https://$host$request_uri; | |
} |
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
openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment