Author Topic: Apache tweak or Nginx rewrite or... to fix Roundcube Owncloud Plugin Limitations  (Read 2947 times)

Offline StephenD

  • Newbie
  • *
  • Posts: 1
Working setup of Apache serving Roundcubemail and Owncloud, proxying through Nginx without fast_CGI.

Users connecting to

https://webmail.example.com must enter https://webmail.example.com/rouncubemail because of the limitations of the Roundcubemail Owncloud plugin that displays owncloud inside roundcubemail.

The only way we have been able to get the plugin to work is to set things up as below:

$rcmail_config['owncloud_url'] = 'http://webmail.example.com/owncloud';

with the corresponding apache vhosts:

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

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

If roundcubemail is appended to "/var/www/html" as one would expect the plugin stops working. The owncloud URL must be an absolute URL with no subdomains. Is this correct?

and Niginx

server {
    listen   443;
    root /var/www/html/roundcubemail;
    index index.php index.html index.htm;
    server_name webmail.example.com;
    ssl                  on;
    ssl_certificate    /etc/pki/tls/webmail.example.com.crt;
    ssl_certificate_key    /etc/pki/tls/private/webmail.example.com.key;
    ssl_session_timeout  5m;
    error_log /var/log/nginx/proxyerrorlog;
    ssl_protocols  SSLv3 TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+EXP;
    ssl_prefer_server_ciphers   on;
    location / {
    try_files $uri $uri/ /index.php;
    }
    location ~ \.php$ {
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_pass http://172.21.11.48:80;
    }
    location ~ /\.ht {
    deny all;
    }

So my question is how is this situation best handled? so users can enter

https://webmail.example.com

Can it be fixed with some Apache magic or in Nginx or something else. I found the Nginx documentation impenetrable and have so far only managed to enter a rewrite loop or end up with https://webmail.example.com/index.php/roundcubemail so any tips greatly appreciated.