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

78 lines
2 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 }};
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 %}
server {
listen 80;
listen [::]:80;
server_name firmware.{{ mesh.http_domain_external }} firmware.{{ mesh.http_domain_internal }};
charset utf-8;
server_tokens off;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
root /var/www/html/firmware/{{ mesh.site_name.lower() }};
location / {
autoindex on;
autoindex_exact_size off;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name firmware.{{ mesh.http_domain_external }} firmware.{{ mesh.http_domain_internal }};
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.site_name.lower() }};
location / {
autoindex on;
autoindex_exact_size off;
}
}
{% if not loop.last %}
{% endif %}
{% endfor %}