ansible-ffibk/roles/service-nginx-firmware/templates/firmware_vhost.conf.j2

92 lines
2.4 KiB
Django/Jinja

server {
listen 80;
listen [::]:80;
server_name firmware.{{ http_domain_external }} firmware.{{ http_domain_internal }};
charset utf-8;
server_tokens off;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
root /var/www/html/firmware;
location / {
autoindex on;
autoindex_exact_size off;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name firmware.{{ http_domain_external }} firmware.{{ http_domain_internal }};
add_header 'Access-Control-Allow-Origin' '*';
charset utf-8;
server_tokens off;
ssl_certificate /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/privkey.pem;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
root /var/www/html/firmware;
location / {
autoindex on;
autoindex_exact_size off;
}
}
{% for mesh in meshes %}
{% if mesh.legacy is defined %}
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;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
root /var/www/html/firmware/{{ mesh.domain_name.lower().rsplit(' ')[0] }};
location / {
autoindex on;
autoindex_exact_size off;
}
}
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' '*';
charset utf-8;
server_tokens off;
ssl_certificate /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/privkey.pem;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
root /var/www/html/firmware/{{ mesh.domain_name.lower().rsplit(' ')[0] }};
location / {
autoindex on;
autoindex_exact_size off;
}
}
{% if not loop.last %}
{% endif %}
{% endif %}
{% endfor %}