Make variable http_domain_external in list element of meshes optional.

This commit is contained in:
Tobias Hachmer 2018-12-30 23:39:41 +01:00
parent 7dac321cd1
commit 1be513fae9
No known key found for this signature in database
GPG key ID: E112788464CA5C60
2 changed files with 17 additions and 1 deletions

View file

@ -41,7 +41,11 @@ server {
server {
listen 80;
listen [::]:80;
{% if mesh.http_domain_external is defined %}
server_name firmware.{{ mesh.http_domain_external }} firmware.{{ mesh.http_domain_internal }};
{% else %}
server_name firmware.{{ mesh.http_domain_internal }};
{% endif %}
charset utf-8;
server_tokens off;
@ -58,7 +62,11 @@ server {
server {
listen 443 ssl;
listen [::]:443 ssl;
{% if mesh.http_domain_external is defined %}
server_name firmware.{{ mesh.http_domain_external }} firmware.{{ mesh.http_domain_internal }};
{% else %}
server_name firmware.{{ mesh.http_domain_internal }};
{% endif %}
add_header 'Access-Control-Allow-Origin' '*';

View file

@ -58,7 +58,11 @@ server {
server {
listen 80;
listen [::]:80;
{% if mesh.http_domain_external is defined %}
server_name {{ http_meshviewer_prefix }}.{{ mesh.http_domain_external }} {{ http_meshviewer_prefix }}.{{ mesh.http_domain_internal }};
{% else %}
server_name {{ http_meshviewer_prefix }}.{{ mesh.http_domain_internal }};
{% endif %}
return 301 https://{{ http_meshviewer_external }}$request_uri;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
@ -67,7 +71,11 @@ server {
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ http_meshviewer_prefix }}.{{ mesh.http_domain_internal }} {{ http_meshviewer_prefix }}.{{ mesh.http_domain_external }};
{% if mesh.http_domain_external is defined %}
server_name {{ http_meshviewer_prefix }}.{{ mesh.http_domain_external }} {{ http_meshviewer_prefix }}.{{ mesh.http_domain_internal }};
{% else %}
server_name {{ http_meshviewer_prefix }}.{{ mesh.http_domain_internal }};
{% endif %}
return 301 https://{{ http_meshviewer_external }}$request_uri;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;