Created
May 16, 2018 16:38
-
-
Save avoidik/9914acd3eccf235e5ba10826b44a4396 to your computer and use it in GitHub Desktop.
simple nginx sni config
This file contains hidden or 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 { | |
| listen 80; | |
| server_name _; | |
| return 301 http://$http_host$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name api.newerserver.com; | |
| ssl_certificate "/etc/nginx/domain.crt"; | |
| ssl_certificate_key "/etc/nginx/domain.key"; | |
| ssl_session_timeout 10m; | |
| ssl_ciphers HIGH:!aNULL:!MD5; | |
| ssl_prefer_server_ciphers on; | |
| location / { | |
| proxy_redirect off; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_pass http://127.0.0.1:9000; | |
| } | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name api.oldserver.com; | |
| ssl_certificate "/etc/nginx/olddomain.crt"; | |
| ssl_certificate_key "/etc/nginx/olddomain.key"; | |
| ssl_session_timeout 10m; | |
| ssl_ciphers HIGH:!aNULL:!MD5; | |
| ssl_prefer_server_ciphers on; | |
| location / { | |
| proxy_redirect off; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_pass http://127.0.0.1:9000; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment