ansible-config/roles/hopglass-frontend/templates/nginx-site.j2
2018-11-16 22:34:59 +01:00

35 lines
900 B
Django/Jinja

{% if hopglass_frontend_tls_crt is defined %}
server {
server_name map.hamburg.freifunk.net hopglass.hamburg.freifunk.net;
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate {{ hopglass_frontend_tls_crt }};
ssl_certificate_key {{ hopglass_frontend_tls_key }};
include snippets/header-hsts.conf;
include snippets/header-security.conf;
include snippets/no-unsafe-files.conf;
root {{ hopglass_frontend_path }}/build;
}
{% endif %}
server {
server_name map.hamburg.freifunk.net hopglass.hamburg.freifunk.net;
listen 80;
listen [::]:80;
{% if hopglass_frontend_tls_crt is defined %}
location / {
return 302 https://$host$request_uri;
}
{% else %}
include snippets/header-security.conf;
include snippets/no-unsafe-files.conf;
root {{ hopglass_frontend_path }}/build;
{% endif %}
include snippets/location-acme.conf;
}