-
-
Save kenperkins/cdecd152d0384bd40cb7 to your computer and use it in GitHub Desktop.
Unable to get SNI Working with nginx v1.4.1
This file contains 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
user www-data; | |
worker_processes 4; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
} | |
http { | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
gzip on; | |
gzip_disable "msie6"; | |
include /etc/nginx/sites-enabled/*; | |
} |
This file contains 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
ssl on; | |
ssl_ciphers AES256-SHA:AES128-SHA:RC4-SHA:RC4-MD5; |
This file contains 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
# | |
# HTTPS/SSL Server ######################################################### | |
# | |
upstream foo { | |
server app-01.private.example.com:1000; | |
} | |
server { | |
listen 1.2.3.4:443 ssl; | |
server_name foo.com; | |
include conf.d/ssl.conf; | |
ssl_certificate /etc/nginx/certs/foo.com-combined.crt; | |
ssl_certificate_key /etc/nginx/certs/foo.com.key; | |
location / { | |
proxy_pass https://foo; | |
} | |
} | |
server { | |
listen 1.2.3.4:443 ssl; | |
server_name www.foo.com; | |
include conf.d/ssl.conf; | |
ssl_certificate /etc/nginx/certs/foo.com-combined.crt; | |
ssl_certificate_key /etc/nginx/certs/foo.com.key; | |
rewrite ^ $scheme://foo.com$request_uri? permanent; | |
} | |
server { | |
listen 1.2.3.4:80; | |
server_name foo.com www.foo.com; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} |
This file contains 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
# | |
# HTTPS/SSL Server ######################################################### | |
# | |
upstream bar { | |
server app-01.private.example.com:1001; | |
} | |
server { | |
listen 1.2.3.4:443 ssl; | |
server_name bar.com; | |
include conf.d/ssl.conf; | |
ssl_certificate /etc/nginx/certs/bar.com-combined.crt; | |
ssl_certificate_key /etc/nginx/certs/bar.com.key; | |
location / { | |
proxy_pass https://bar; | |
} | |
} | |
server { | |
listen 1.2.3.4:443 ssl; | |
server_name www.bar.com; | |
include conf.d/ssl.conf; | |
ssl_certificate /etc/nginx/certs/bar.com-combined.crt; | |
ssl_certificate_key /etc/nginx/certs/bar.com.key; | |
rewrite ^ $scheme://bar.com$request_uri? permanent; | |
} | |
server { | |
listen 1.2.3.4:80; | |
server_name bar.com www.bar.com; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment