Merge pull request #713 from pgeorgi/extend-nginx

nginx: Allow extending config with overrides
This commit is contained in:
Tim Möhlmann
2018-12-09 21:44:24 +02:00
committed by GitHub
7 changed files with 23 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ COPY *.py /
EXPOSE 80/tcp 443/tcp 110/tcp 143/tcp 465/tcp 587/tcp 993/tcp 995/tcp 25/tcp 10025/tcp 10143/tcp
VOLUME ["/certs"]
VOLUME ["/overrides"]
CMD /start.py

View File

@@ -84,14 +84,19 @@ http {
}
{% else %}
# Actual logic
{% if WEBMAIL != 'none' %}
{% if WEB_WEBMAIL != '/' %}
location / {
return 301 {{ WEB_WEBMAIL }};
}
{% endif %}
include /overrides/*.conf;
# Actual logic
location / {
{% if WEBROOT_REDIRECT and WEB_WEBMAIL != '/' %}
return 301 {{ WEBROOT_REDIRECT }};
{% else %}
return 404;
{% endif %}
}
{% if WEBMAIL != 'none' %}
location {{ WEB_WEBMAIL }} {
{% if WEB_WEBMAIL != '/' %}
rewrite ^({{ WEB_WEBMAIL }})$ $1/ permanent;