Fix for #188 - add SSL server block outside hosts loop
This commit is contained in:
parent
d3f56468b1
commit
d066bd32e0
1 changed files with 12 additions and 1 deletions
13
nginx.tmpl
13
nginx.tmpl
|
@ -54,6 +54,17 @@ server {
|
||||||
return 503;
|
return 503;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}
|
||||||
|
server {
|
||||||
|
server_name _; # This is just an invalid value which will never trigger on a real hostname.
|
||||||
|
listen 443 ssl spdy;
|
||||||
|
return 503;
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/certs/default.crt;
|
||||||
|
ssl_certificate_key /etc/nginx/certs/default.key;
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
||||||
|
|
||||||
upstream {{ $host }} {
|
upstream {{ $host }} {
|
||||||
|
@ -152,7 +163,7 @@ server {
|
||||||
|
|
||||||
{{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}
|
{{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}
|
||||||
server {
|
server {
|
||||||
server_name _;
|
server_name {{ $host }};
|
||||||
listen 443 ssl spdy {{ $default_server }};
|
listen 443 ssl spdy {{ $default_server }};
|
||||||
return 503;
|
return 503;
|
||||||
|
|
||||||
|
|
Reference in a new issue