0

We run roundcubemail and owncloud that have to be accessible independantly. Owncloud is displayed inside roundcubemail via a plug with the url $rcmail_config['owncloud_url'] = 'https://webmail.whitecube.com/owncloud'; - this URL cannot change or the plug-in breaks. Itcan't point to cloud.example.com or it breaks. I have had to set rouncube's webroot to "/var/www/html/" so that the server can access both roundcubemail and owncloud.

<VirtualHost 172.21.11.48:443>
    ServerAlias      "webmail.example.com"
    DocumentRoot    "/var/www/html/"
</VirtualHost>  

<VirtualHost 172.21.11.48:443>
   ServerAlias   "cloud.whitecube.com"
   DocumentRoot    "/var/www/html/owncloud"
 </VirtualHost>

The setup works but users have to enter

       http://webmail.example.com/rouncubemail, I'd like to make it available on 
       http://webmail.whitecube.com.

Whats the best way to achieve this?

Can I alias / to /roundcubemail?

Should I rewrite the URL and append roundcubemail?

Or should I redirect?

I have two issues, first what approach to take and secondly the syntax of the commands. I have to make the sites available internally and externally through Nginx and have googled and googled and am no closer to finessing this. Any tips or help most gratefully received.

Steve
  • 21
  • 4

1 Answers1

0

I'm not sure to understand what is your issue here because you show apache virtual host config section..

To get access on your webmail roundcube through nginx without typing the whole url,
just specify the index field in nginx configuration, here is a sample configuration for nginx :

server {
    server_name webmail.example.com;
    root /var/www/html/;
    index index.html index.htm index.php;
    location  ~ [^/]\.php(/|$){
             try_files $uri $uri/ /index.php;
             fastcgi_split_path_info ^(.+?\.php)(/.*)$;
             if (!-f $document_root$fastcgi_script_name) {return 404;}
             fastcgi_pass unix:/var/run/php5-fpm.sock;
             fastcgi_index index.php;
             include fastcgi_params;
     }
}

the location section here is configured to pass any file.php to an unix socket :
unix:/var/run/php5-fpm.sock

Kuruwan
  • 54
  • 1
  • 8