Accessing Roundcube on / instead /mail

Hello,

I know this is an unsupported modification but how to modify and convert this snippet to yml format to serve roundcube at box.example.com instead of box.example.com/mail ?

 # Roundcube Webmail configuration.
        rewrite ^/mail$ /mail/ redirect;
        rewrite ^/mail/$ /mail/index.php;
        location / {
                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;

Thanks in advance!

I’m not so sure you want to do that. If its too much of a pain for users to access your mail server putting in the /mail at the end a simple script could be put here:

 /home/user-data/www/default/index.html
<html>
        <head>
                <meta http-equiv="refresh" content="0; URL='https://box.(insertyourdomainhere).com/mail'" />
        </head>
        <body>
                <h1>redirecting...</h1>
        </body>
</html>

Thanks for the reply!
We are using this redirecting solution right now and I was just wondering if it would be possible to ‘strip’ /mail from the end of the URL because I sometimes get that users that it would look much ‘nicer’ without the /mail at the end. Do you have any idea?

I haven’t tried it myself yet but seems this might be the answer?

keep in mind you might break access to things like nextcloud

I tried but unfortunately it didn’t work. After some digging I think I phrased my question in a wrong way. I would like to to access the webmail at box.example.com without /mail being visible in the address bar.

Do you have any idea?

Not sure, if there is an easy way to achieve that and especially if there is a way that does not break anything else and / or will get overwritten every time you upgrade your box. I would just tell them, that it’s no possible and that even Google does it like that… :wink:

That’s what it looks like on Gmail:

https://mail.google.com/mail/u/0/#inbox

I think it’s absolutely possible. I personally just don’t see any benefit in doing it. I’m fairly certain that nextcloud (which is used by roundcube for calendar and contacts) will also break. The Admin panel might break. There are just too many variables.