Limit the list page to the URL from INDEX_HOST variable

This commit is contained in:
Marc Carmier 2016-02-13 23:15:41 +01:00
parent 8ddf56babc
commit 326c28899d

View file

@ -55,17 +55,37 @@ server {
server_name _; # This is just an invalid value which will never trigger on a real hostname.
listen 80;
access_log /var/log/nginx/access.log vhost;
return 503;
}
{{ if $.Env.INDEX_HOST }}
server {
server_name {{$.Env.INDEX_HOST}}; # The local site
listen 80;
access_log /var/log/nginx/access.log vhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
{{ end }}
{{ 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 http2;
access_log /var/log/nginx/access.log vhost;
return 503;
ssl_certificate /etc/nginx/certs/default.crt;
ssl_certificate_key /etc/nginx/certs/default.key;
}
{{ if $.Env.INDEX_HOST }}
server {
server_name {{$.Env.INDEX_HOST}}; # The local site
listen 443 ssl http2;
access_log /var/log/nginx/access.log vhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
@ -75,6 +95,7 @@ server {
ssl_certificate_key /etc/nginx/certs/default.key;
}
{{ end }}
{{ end }}
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}