Merge pull request #713 from pgeorgi/extend-nginx

nginx: Allow extending config with overrides
master
Tim Möhlmann 6 years ago committed by GitHub
commit c7dcfee882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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;

@ -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

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

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

@ -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 }}

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

Loading…
Cancel
Save