Apps can't connect to subfolder RC instance


#1

Hello Rocket.Chat Forum!
I’ve been trying to set up my own instance on my VPS.
Because there’s already a website running on Apache with a valid Let’s Encrypt certificate, I opted to use the subdirectory installation.

Installation was performed manually, oplog not configured, ROOT_URL set to https://domain.com/chat/, proxy is configured.

It works via webbrowser aswell as the windows desktop client (need to enter an extra slash at the end), but not in the (various) Android apps.
The native app just flashes an error message upon trying to login:
“chat.rocket.android_ddp.DDPClientCallback$Closed”

I have used Google and tried my best to fix this myself, but to no avail.
Here is my apache2 site conf:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName www.domain.com
ServerAlias domain.com *.domain.com
ServerAdmin mail@domain.com
UseCanonicalName On
DocumentRoot /var/www/domain

    <a few Directory tags>

    `<Location /chat>`
        Order allow,deny
        Allow from all

        RewriteEngine On
        RewriteCond %{HTTP:Upgrade} =websocket [NC]
        RewriteRule /var/www/domain/(.*)           ws://localhost:3000/$1 [P,L]
        RewriteCond %{HTTP:Upgrade} !=websocket [NC]
        RewriteRule /var/www/domain/(.*)           http://localhost:3000/$1 [P,L]
        ProxyPassReverse http://localhost:3000
    </Location>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/domain.com/chain.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Thanks in advance for any help provided!
~Panki


#2

Have you tried this in more recent versions of the app? If i’m not mistaken it should work.