Role service-nginx-meshviewer: add additional domains

Our meshes structure only supports two domains (internal/external).
This adds a list called `meshviewer_additional_domains` which will be
prefixed with `map.` and redirected to the main Meshviewer domain.
This commit is contained in:
Julian Labus 2019-07-16 16:15:32 +02:00
parent fb2c6cb07a
commit 876c93737d
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
2 changed files with 28 additions and 0 deletions

View file

@ -25,3 +25,6 @@ alertmanager_opts: "--web.external-url=https://{{ http_prometheus_prefix }}.{{ h
yanic_blacklist: yanic_blacklist:
- 98ded0c5e0c0 - 98ded0c5e0c0
meshviewer_additional_domains:
- freifunk-wiesbaden.de

View file

@ -86,3 +86,28 @@ server {
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if meshviewer_additional_domains is defined %}
{% for domain in meshviewer_additional_domains %}
server {
listen 80;
listen [::]:80;
server_name {{ http_meshviewer_prefix }}.{{ domain }};
return 301 https://{{ http_meshviewer_external }}$request_uri;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ http_meshviewer_prefix }}.{{ domain }};
return 301 https://{{ http_meshviewer_external }}$request_uri;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
}
{% if not loop.last %}
{% endif %}
{% endfor %}
{% endif %}