ansible-config/roles/hopglass-frontend/templates/nginx-site.j2

31 lines
787 B
Plaintext
Raw Normal View History

2018-11-03 00:00:16 +01:00
{% if hopglass_frontend_tls_crt is defined %}
server {
2018-11-05 21:30:34 +01:00
server_name map.hamburg.freifunk.net hopglass.hamburg.freifunk.net;
2018-11-03 00:00:16 +01:00
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate {{ hopglass_frontend_tls_crt }};
ssl_certificate_key {{ hopglass_frontend_tls_key }};
2018-11-10 14:39:10 +01:00
include snippets/header-hsts.conf;
include snippets/no-unsafe-files.conf;
2018-11-03 00:00:16 +01:00
root {{ hopglass_frontend_path }}/build;
}
{% endif %}
server {
2018-11-05 21:30:34 +01:00
server_name map.hamburg.freifunk.net hopglass.hamburg.freifunk.net;
2018-11-03 00:00:16 +01:00
listen 80;
listen [::]:80;
{% if hopglass_frontend_tls_crt is defined %}
2018-11-10 14:39:10 +01:00
return 302 https://$host$request_uri;
2018-11-03 00:00:16 +01:00
{% else %}
2018-11-10 14:39:10 +01:00
include snippets/no-unsafe-files.conf;
2018-11-03 00:00:16 +01:00
root {{ hopglass_frontend_path }}/build;
{% endif %}
2018-11-10 14:39:10 +01:00
include snippets/location-acme.conf;
2018-11-03 00:00:16 +01:00
}