Running under subpath but the upload file urls are broken

Description

Hi,

I have been using RC for couple years now, and I serve it under a subpath like https://DOMAIN/rc/ which has worked great all this time, no problems with uploads or chats.

I recently upgraded with docker pull. Now everything still works except that my uploads and the previews are broken. The reason it seems that they are served under file-upload instead of rc/file-uplaod

(based on the js console)

Preview Url

https://DOMAIN/file-upload/oAmmYnCNZcKdchBHp/test.jpg (this file naturally is broken in the client app)

which should be

https://DOMAIN/rc/file-upload/oAmmYnCNZcKdchBHp/test.jpg

Here is how one of the test upload images looks

aasd

Downloading the image seems to work, this must be about the thumbnail images only.

I never had this issue, so it must be some new feature or change breaking file uploads/downloads.

My ROOT_URL and the URL in admin->general is the same. Like I said my setup has been in good condition for quite a while.

This is my Apache reverse proxy

<Location /rc>
            Order allow,deny
            Allow from all

            RewriteEngine On
            RewriteCond %{HTTP:Upgrade} =websocket [NC]
            RewriteRule /var/www/html/(.*)           ws://localhost:2000/$1 [P,L]
            RewriteCond %{HTTP:Upgrade} !=websocket [NC]
            RewriteRule /var/www/html/(.*)           http://localhost:2000/$1 [P,L]

            ProxyPassReverse http://localhost:2000

        </Location>

Server Setup Information

  • Version of Rocket.Chat Server: 3.14.0
  • Operating System: Linux
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.12
  • Proxy: Apache
  • Firewalls involved: No

Any additional Information

Hi.

OK the answer here is long and complicated.

Please read here first.

There are a number of bugs on this as well - you should always check these things in the release notes and Issue before upgrading.

However, with the recent growth of Rocket.Chat there have been discussions about whether we should either drop support completely, or continue it. This has not yet been resolved so I have no definite answer here as yet but I am hoping it will be resurrected, though I have no idea on timescale.

I would suggest you +1 an existing bug, or open a new one… it may be closed as a duplicate but will register the point.

1 Like

PS - use the latest 3.14.4

It has a security fix you really should use (and another reason to follow issues and releases closely)

1 Like

I am able to make the file uploads/downloads work if I remove the site url from the Admin->General line (only passed via the environment to the Docker setup) . However the thumbnails are still broken in the web client and the desktop client. The weird thing is that the Android client has no issues with the previews.

OK - there are a number of issue relating to this.

It is quite complex. Suffice to say as above support for sub directory/subpath installation was going to be pulled completely - and it has been neglected as a result.

The good news.

For a variety of reason there has been a change of direction and we are going to continue to support this.

I think your issue is likely here (there are several similar)

This is on the program to be fixed - quite probably in 3.16 but I don’t know for sure as yet.

1 Like