1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-17 20:57:54 +02:00

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
commit c7dcfee882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;

View File

@ -100,6 +100,9 @@ COMPRESSION_LEVEL=
# Web settings
###################################
# Path to redirect / to
WEBROOT_REDIRECT=/webmail
# Path to the admin interface if enabled
WEB_ADMIN=/admin

View File

@ -29,6 +29,7 @@ services:
- "$BIND_ADDRESS6:587:587"
volumes:
- "$ROOT/certs:/certs"
- "$ROOT/overrides/nginx:/overrides"
redis:
image: redis:alpine

View File

@ -32,7 +32,8 @@ services:
{% endfor %}
volumes:
- "{{ root }}/certs:/certs"
- "{{ root }}/overrides/nginx:/overrides"
{% if resolver_enabled %}
resolver:
image: mailu/unbound:{{ version }}

View File

@ -111,6 +111,9 @@ COMPRESSION_LEVEL={{ compression_level }}
# Web settings
###################################
# Path to redirect / to
WEBROOT_REDIRECT=/webmail
# Path to the admin interface if enabled
WEB_ADMIN={{ admin_path }}

View File

@ -27,6 +27,7 @@ services:
{% endfor %}
volumes:
- "{{ root }}/certs:/certs"
- "{{ root }}/overrides/nginx:/overrides"
deploy:
replicas: {{ front_replicas }}