nginx: Allow extending config with overrides
To facilitate this, the default redirect at / can be disabled, even if the default remains at redirecting to the webmailer. The extensions are within the host scope and are read from $ROOT/overrides/nginx/*.conf.
This commit is contained in:
@@ -84,14 +84,16 @@ http {
|
||||
}
|
||||
{% else %}
|
||||
|
||||
include /overrides/*.conf;
|
||||
|
||||
# Actual logic
|
||||
{% if WEBMAIL != 'none' %}
|
||||
{% if WEB_WEBMAIL != '/' %}
|
||||
{% if WEBROOT_REDIRECT %}
|
||||
location / {
|
||||
return 301 {{ WEB_WEBMAIL }};
|
||||
return 301 {{ WEBROOT_REDIRECT }};
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if WEBMAIL != 'none' %}
|
||||
location {{ WEB_WEBMAIL }} {
|
||||
{% if WEB_WEBMAIL != '/' %}
|
||||
rewrite ^({{ WEB_WEBMAIL }})$ $1/ permanent;
|
||||
|
||||
Reference in New Issue
Block a user