I have a mailcow server where Roundcube is in a separate subdomain than Mailcow UI. Mailcow UI is only accessible from the internal network. Users only have access to the Roundcube web client. The entire configuration is centralized and the end user cannot make any changes. After updating Roundcube from 1.5.0 to 1.6.0 Roundcube on a separate subdomain than Mailcow UI does not work properly. The login window is open, but when I want to log in, I get a 404 Not Found message. In the mailcowdockerized-nginx-mailcow-1 logs, I found that a double / rc / rc is added when reverse from nginx. Before Roundcube 1.6.0 everything was working so I started looking for changes to the RoundCube code and found that these were changes to “Referrer-Policy: ”strict-origin" breaks some functionality #8170" issue. When I change this code everything works, but I don’t want to change the RoundCube code. Below is my configuration with nginx which reverse to mailcowdockerized-nginx-mailcow-1. Can you advise me some solution where I can still have Roundcube on a separate subdomain and don’t need to change the Roundcube code?
Nginx proxy:
` location / {
rewrite "^$" /rc/ last;
proxy_pass http://127.0.0.1:8080/rc/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m;
}`
docker-compose logs -f –tail=200 nginx-mailcow
mailcowdockerized-nginx-mailcow-1 | 192.*.*.* - - [01/Sep/2022:14:14:12 +0200] "POST /rc/rc/?_task=login HTTP/1.0" 404 146 "https://poczta.sub.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0"
Code in RoundCube which I have to change:
/opt/mailcow-dockerized/data/web/rc/program/include/rcmail.php
if ($absolute || $full) {
// add base path to this Roundcube installation
$prefix = $base_path ?: '/';
// prepend protocol://hostname:port
if ($full) {
$prefix = rcube_utils::resolve_url($prefix);
}
$prefix = rtrim($prefix, '/') . '/';
}
// else {
// if (isset($_SERVER['REQUEST_URI'])) {
// $prefix = preg_replace('/[?&].*$/', '', $_SERVER['REQUEST_URI']) ?: './';
// }
// else {
// $prefix = './';
// }
// }
return $prefix . $url;
}