You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-07-17 01:32:29 +02:00
Merge pull request #713 from pgeorgi/extend-nginx
nginx: Allow extending config with overrides
This commit is contained in:
@ -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
|
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 ["/certs"]
|
||||||
|
VOLUME ["/overrides"]
|
||||||
|
|
||||||
CMD /start.py
|
CMD /start.py
|
||||||
|
|
||||||
|
@ -84,14 +84,19 @@ http {
|
|||||||
}
|
}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
# Actual logic
|
include /overrides/*.conf;
|
||||||
{% if WEBMAIL != 'none' %}
|
|
||||||
{% if WEB_WEBMAIL != '/' %}
|
|
||||||
location / {
|
|
||||||
return 301 {{ WEB_WEBMAIL }};
|
|
||||||
}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
# Actual logic
|
||||||
|
|
||||||
|
location / {
|
||||||
|
{% if WEBROOT_REDIRECT and WEB_WEBMAIL != '/' %}
|
||||||
|
return 301 {{ WEBROOT_REDIRECT }};
|
||||||
|
{% else %}
|
||||||
|
return 404;
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
|
||||||
|
{% if WEBMAIL != 'none' %}
|
||||||
location {{ WEB_WEBMAIL }} {
|
location {{ WEB_WEBMAIL }} {
|
||||||
{% if WEB_WEBMAIL != '/' %}
|
{% if WEB_WEBMAIL != '/' %}
|
||||||
rewrite ^({{ WEB_WEBMAIL }})$ $1/ permanent;
|
rewrite ^({{ WEB_WEBMAIL }})$ $1/ permanent;
|
||||||
|
@ -100,6 +100,9 @@ COMPRESSION_LEVEL=
|
|||||||
# Web settings
|
# Web settings
|
||||||
###################################
|
###################################
|
||||||
|
|
||||||
|
# Path to redirect / to
|
||||||
|
WEBROOT_REDIRECT=/webmail
|
||||||
|
|
||||||
# Path to the admin interface if enabled
|
# Path to the admin interface if enabled
|
||||||
WEB_ADMIN=/admin
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ services:
|
|||||||
- "$BIND_ADDRESS6:587:587"
|
- "$BIND_ADDRESS6:587:587"
|
||||||
volumes:
|
volumes:
|
||||||
- "$ROOT/certs:/certs"
|
- "$ROOT/certs:/certs"
|
||||||
|
- "$ROOT/overrides/nginx:/overrides"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
|
@ -32,7 +32,8 @@ services:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ root }}/certs:/certs"
|
- "{{ root }}/certs:/certs"
|
||||||
|
- "{{ root }}/overrides/nginx:/overrides"
|
||||||
|
|
||||||
{% if resolver_enabled %}
|
{% if resolver_enabled %}
|
||||||
resolver:
|
resolver:
|
||||||
image: mailu/unbound:{{ version }}
|
image: mailu/unbound:{{ version }}
|
||||||
|
@ -111,6 +111,9 @@ COMPRESSION_LEVEL={{ compression_level }}
|
|||||||
# Web settings
|
# Web settings
|
||||||
###################################
|
###################################
|
||||||
|
|
||||||
|
# Path to redirect / to
|
||||||
|
WEBROOT_REDIRECT=/webmail
|
||||||
|
|
||||||
# Path to the admin interface if enabled
|
# Path to the admin interface if enabled
|
||||||
WEB_ADMIN={{ admin_path }}
|
WEB_ADMIN={{ admin_path }}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ services:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ root }}/certs:/certs"
|
- "{{ root }}/certs:/certs"
|
||||||
|
- "{{ root }}/overrides/nginx:/overrides"
|
||||||
deploy:
|
deploy:
|
||||||
replicas: {{ front_replicas }}
|
replicas: {{ front_replicas }}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user