Make variable http_domain_external in list element of meshes optional.
This commit is contained in:
parent
7dac321cd1
commit
1be513fae9
2 changed files with 17 additions and 1 deletions
|
@ -41,7 +41,11 @@ server {
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
{% if mesh.http_domain_external is defined %}
|
||||||
server_name firmware.{{ mesh.http_domain_external }} firmware.{{ mesh.http_domain_internal }};
|
server_name firmware.{{ mesh.http_domain_external }} firmware.{{ mesh.http_domain_internal }};
|
||||||
|
{% else %}
|
||||||
|
server_name firmware.{{ mesh.http_domain_internal }};
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
|
@ -58,7 +62,11 @@ server {
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
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 }};
|
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' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,11 @@ server {
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
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 }};
|
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;
|
return 301 https://{{ http_meshviewer_external }}$request_uri;
|
||||||
|
|
||||||
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
|
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
|
||||||
|
@ -67,7 +71,11 @@ server {
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
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;
|
return 301 https://{{ http_meshviewer_external }}$request_uri;
|
||||||
|
|
||||||
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
|
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
|
||||||
|
|
Loading…
Reference in a new issue