49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
map $http_host $comun_{{ vhost.nodo | replace(".", "_") }} {
|
|
hostnames;
|
|
{% for domain in vhost.domains %}
|
|
.{{ domain }} {{ vhost.nodo }};
|
|
{% endfor %}
|
|
}
|
|
|
|
server {
|
|
server_name .{{ vhost.domains | join(' .') }};
|
|
|
|
listen 80;
|
|
|
|
resolver 127.0.0.1 valid=300s;
|
|
resolver_timeout 5s;
|
|
|
|
{% if not needs_vhost and ((vhost.ssl | default(domains_default_ssl) ) or (vhost.force_https | default(domains_default_force_https))) %}
|
|
listen 443 ssl;
|
|
|
|
# letsencrypt
|
|
ssl_certificate {{ nginx_certs_path }}/live/{{ vhost.domains[0] }}/fullchain.pem;
|
|
ssl_certificate_key {{ nginx_certs_path }}/live/{{ vhost.domains[0] }}/privkey.pem;
|
|
|
|
include conf/common_ssl.conf;
|
|
|
|
{% if vhost.force_https | default(domains_default_force_https) %}
|
|
if ($scheme != 'https') {
|
|
rewrite ^/(.*)$ https://$host/$1 redirect;
|
|
}
|
|
|
|
{% else %}
|
|
if ($scheme != 'https') {
|
|
rewrite ^/(.*)admin/(.*)$ https://$host/$1admin/$2 redirect;
|
|
rewrite ^/(.*)login/(.*)$ https://$host/$1login/$2 redirect;
|
|
}
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
include conf/common.conf;
|
|
|
|
{% include "default_proxy.conf" %}
|
|
|
|
{% include "files/custom_server_includes/" ~ vhost.domains[0] ignore missing %}
|
|
|
|
}
|
|
|
|
|
|
|