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

93 lines
2.4 KiB
Text
Raw Normal View History

2017-10-27 11:41:00 +02:00
server {
listen 80;
listen [::]:80;
server_name firmware.{{ http_domain_external }} firmware.{{ http_domain_internal }};
2017-10-27 11:41:00 +02:00
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;
2017-10-27 11:41:00 +02:00
root /var/www/html/firmware;
location / {
autoindex on;
autoindex_exact_size off;
}
}
{% for mesh in meshes %}
2019-03-02 18:10:48 +01:00
{% if mesh.legacy is defined %}
2017-10-27 11:41:00 +02:00
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 %}
2017-10-27 11:41:00 +02:00
charset utf-8;
server_tokens off;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
2019-03-02 18:10:48 +01:00
root /var/www/html/firmware/{{ mesh.domain_name.lower() }};
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;
2019-03-02 18:10:48 +01:00
root /var/www/html/firmware/{{ mesh.domain_name.lower() }};
2017-10-27 11:41:00 +02:00
location / {
autoindex on;
autoindex_exact_size off;
}
}
{% if not loop.last %}
2019-03-02 18:10:48 +01:00
{% endif %}
2017-10-27 11:41:00 +02:00
{% endif %}
{% endfor %}