When you install Roundcube from a distribution package (for example a .deb package on Ubuntu) the package installs files under /usr/share/roundcube/ If you want to serve Roudncube from a different URI than /roundcube/, then you have two options (maybe more):
- Create a softlink with the desired name in the document root folder to the roundcube folder
- Use the alias directive of Nginx
The problem with the second option is that the default fastcgi.conf Nginx config will create the wrong SCRIPT_FILENAME value, thus PHP will not find the PHP file. The solutions is to overwrite this parameter value with the correct one:
location /mail/ {
alias /usr/share/roundcube/;
try_files $uri $uri/ /index.php?$args;
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}