Skip to content

Instantly share code, notes, and snippets.

@sanguis
Created April 30, 2013 14:11
Show Gist options
  • Save sanguis/5488977 to your computer and use it in GitHub Desktop.
Save sanguis/5488977 to your computer and use it in GitHub Desktop.
nginx redirect ssl or domain to domain
server {
listen 80;
server_name support.knectar.com;
rewrite ^/(.*) https://rwww.example.com/$1 permanent;
}
server {
listen 443;
ssl on;
ssl_certificate /home/sites/certs/ssl-bundle.crt;
ssl_certificate_key /home/sites/certs/myserver.key;
#enables SSLv3/TLSv1, but not SSLv2 which is weak and should no longer be used.
ssl_protocols SSLv3 TLSv1;
#Disables all weak ciphers
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment