Skip to content

Instantly share code, notes, and snippets.

@a10y
Last active January 23, 2016 08:55
Show Gist options
  • Save a10y/7de97a59654881cc73c1 to your computer and use it in GitHub Desktop.
Save a10y/7de97a59654881cc73c1 to your computer and use it in GitHub Desktop.
Nginx + LetsEncrypt Configuration With Proxying to Github Pages
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name aduffy.org;
return 301 https://aduffy.org$request_uri;
}
server {
listen 443 ssl;
server_name aduffy.org;
ssl_certificate /etc/letsencrypt/live/aduffy.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/aduffy.org/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK';
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/aduffy.org/chain.pem;
resolver 8.8.8.8 8.8.4.4 valid=86400;
resolver_timeout 10;
add_header Strict-Transport-Security max-age=15768000;
location / {
proxy_pass http://andreweduffy.github.com;
proxy_redirect default;
proxy_buffering off;
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-Protocol $scheme;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment