Skip to content

Instantly share code, notes, and snippets.

@colinrymer
Created July 3, 2015 17:57
Show Gist options
  • Save colinrymer/93b7d2d94c677ff36154 to your computer and use it in GitHub Desktop.
Save colinrymer/93b7d2d94c677ff36154 to your computer and use it in GitHub Desktop.
server blocks of nginx configuration
server {
listen 80 default_server;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl default_server;
ssl_certificate /etc/nginx/ssl/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/ssl-private.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/ssl/dhparams.pem;
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 RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
gzip on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
access_log /proc/self/fd/1;
error_log /proc/self/fd/1 info;
client_max_body_size 50m;
location / {
proxy_pass http://app;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment