Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Last active August 29, 2015 13:58
Show Gist options
  • Save luckyruby/10315456 to your computer and use it in GitHub Desktop.
Save luckyruby/10315456 to your computer and use it in GitHub Desktop.
server {
listen 192.168.11.100:80;
server_name foo.domain.com;
error_page 497 =301 https://$server_name$request_uri;
}
server {
listen 192.168.11.100:443 default_server ssl;
server_name foo.domain.com;
ssl_certificate ssl/domain.com_bundle.crt;
ssl_certificate_key ssl/domain.com.key;
# ssl_session_cache builtin:1000 shared:SSL:10m;
# ssl_session_timeout 5m;
# ssl_ecdh_curve secp521r1;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;
# ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA;
#HSTS
# add_header Strict-Transport-Security max-age=15552000;
# if ($scheme = http) {
# return 301 https://$server_name$request_uri;
# }
location / {
proxy_pass http://192.168.11.30;
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