From 81c64f0a8f3b44fc10c57d4538743937e5c859f8 Mon Sep 17 00:00:00 2001 From: David Duque Date: Sun, 27 Sep 2020 02:05:16 +0100 Subject: [PATCH] Re-add webmail roundcube (to primaryonly) --- conf/nginx-primaryonly.conf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/conf/nginx-primaryonly.conf b/conf/nginx-primaryonly.conf index 7c9bb7b..31e50d5 100644 --- a/conf/nginx-primaryonly.conf +++ b/conf/nginx-primaryonly.conf @@ -16,6 +16,30 @@ add_header Content-Security-Policy "frame-ancestors 'none';"; } + # Roundcube Webmail configuration. + rewrite ^/mail$ /mail/ redirect; + rewrite ^/mail/$ /mail/index.php; + location /mail/ { + index index.php; + alias /usr/local/lib/roundcubemail/; + } + location ~ /mail/config/.* { + # A ~-style location is needed to give this precedence over the next block. + return 403; + } + location ~ /mail/.*\.php { + # note: ~ has precendence over a regular location block + include fastcgi_params; + fastcgi_split_path_info ^/mail(/.*)()$; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /usr/local/lib/roundcubemail/$fastcgi_script_name; + fastcgi_pass php-fpm; + + # Outgoing mail also goes through this endpoint, so increase the maximum + # file upload limit to match the corresponding Postfix limit. + client_max_body_size 128M; + } + # Nextcloud configuration. rewrite ^/cloud$ /cloud/ redirect; rewrite ^/cloud/$ /cloud/index.php;