|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
# Basic configuration
|
|
|
|
|
# Basic configuration
|
|
|
|
|
user nginx;
|
|
|
|
|
worker_processes auto;
|
|
|
|
|
error_log /dev/stderr info;
|
|
|
|
@ -6,7 +6,7 @@ pid /var/run/nginx.pid;
|
|
|
|
|
load_module "modules/ngx_mail_module.so";
|
|
|
|
|
|
|
|
|
|
events {
|
|
|
|
|
worker_connections 1024;
|
|
|
|
|
worker_connections 1024;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
http {
|
|
|
|
@ -15,7 +15,7 @@ http {
|
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
access_log /dev/stdout;
|
|
|
|
|
sendfile on;
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
server_tokens off;
|
|
|
|
|
absolute_redirect off;
|
|
|
|
|
resolver {{ RESOLVER }} ipv6=off valid=30s;
|
|
|
|
@ -47,12 +47,12 @@ http {
|
|
|
|
|
|
|
|
|
|
{% if KUBERNETES_INGRESS != 'true' and TLS_FLAVOR in [ 'letsencrypt', 'cert' ] %}
|
|
|
|
|
# Enable the proxy for certbot if the flavor is letsencrypt and not on kubernetes
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
server {
|
|
|
|
|
# Listen over HTTP
|
|
|
|
|
listen 80;
|
|
|
|
|
listen [::]:80;
|
|
|
|
|
{% if TLS_FLAVOR == 'letsencrypt' %}
|
|
|
|
|
{% if TLS_FLAVOR == 'letsencrypt' %}
|
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
|
|
|
proxy_pass http://127.0.0.1:8008;
|
|
|
|
|
}
|
|
|
|
@ -80,7 +80,7 @@ http {
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
# Listen on HTTP only in kubernetes or behind reverse proxy
|
|
|
|
|
{% if KUBERNETES_INGRESS == 'true' or TLS_FLAVOR in [ 'mail-letsencrypt', 'notls', 'mail' ] %}
|
|
|
|
|
{% if KUBERNETES_INGRESS == 'true' or TLS_FLAVOR in [ 'mail-letsencrypt', 'notls', 'mail' ] %}
|
|
|
|
|
listen 80;
|
|
|
|
|
listen [::]:80;
|
|
|
|
|
{% endif %}
|
|
|
|
@ -153,8 +153,8 @@ http {
|
|
|
|
|
rewrite ^{{ WEB_WEBMAIL }}/(.*) /$1 break;
|
|
|
|
|
{% endif %}
|
|
|
|
|
include /etc/nginx/proxy.conf;
|
|
|
|
|
client_max_body_size {{ MESSAGE_SIZE_LIMIT|int + 8388608 }};
|
|
|
|
|
auth_request /internal/auth/user;
|
|
|
|
|
client_max_body_size {{ MESSAGE_SIZE_LIMIT|int + 8388608 }};
|
|
|
|
|
auth_request /internal/auth/user;
|
|
|
|
|
error_page 403 @webmail_login;
|
|
|
|
|
proxy_pass http://$webmail;
|
|
|
|
|
}
|
|
|
|
@ -177,7 +177,7 @@ http {
|
|
|
|
|
|
|
|
|
|
location @webmail_login {
|
|
|
|
|
return 302 /sso/login;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if ADMIN == 'true' %}
|
|
|
|
|
location {{ WEB_ADMIN }} {
|
|
|
|
@ -186,7 +186,7 @@ http {
|
|
|
|
|
expires $expires;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location {{ WEB_ADMIN }}/antispam {
|
|
|
|
|
location {{ WEB_ADMIN }}/antispam {
|
|
|
|
|
rewrite ^{{ WEB_ADMIN }}/antispam/(.*) /$1 break;
|
|
|
|
|
auth_request /internal/auth/admin;
|
|
|
|
|
proxy_set_header X-Real-IP "";
|
|
|
|
|