Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Incorrect assets path with subfolder in the url

Open alxlion opened this issue 11 years ago • 5 comments

For a Rocket.Chat instance accessible with http://example.com/chat behind a Nginx proxy, images urls aren't correct: /images/logo/logo.svg instead of /chat/logo/logo.svg or images/logo/logo.svg.

ROOT_URL=http://localhost:3000/chat (Docker container)

alxlion avatar Nov 18 '15 09:11 alxlion

I was just trying to put rocketchat behind a nginx proxy in a location directive, but experienced the same issue. I guess RC needs a dedicated (sub)domain to work. It's a little odd because you can't use an already configured and ssl enabled server and just add RC to it. I wish I had a wildcard cert, but for now I probably just use the letsencrypt beta to create a cert for a subdomain.

On the other hand it's hopefully not too hard to get rocketchat to notice a subfolder ROOT_URL for resource linking. Or is it?

buckyball avatar Nov 18 '15 17:11 buckyball

It seems to be a Meteor restriction...

alxlion avatar Nov 19 '15 09:11 alxlion

This is for sure a meteor restriction. Unfortunately seems the easiest thing is to just create a subdomain. many do: chat.example.com

geekgonecrazy avatar Nov 23 '15 03:11 geekgonecrazy

I'm going to go ahead and close this.

Looks like it may be underway to support this, or something similar?

https://github.com/meteor/meteor/pull/5203 https://github.com/meteor/com.meteor.cordova-update/pull/6

We may want to show our desire for this there. If anyone find a better place to give feedback to them over this please link to it here.

geekgonecrazy avatar Nov 23 '15 05:11 geekgonecrazy

Old bump, might be resolved or discussed elsewhere but I didn't find anything else other than this.

Centos 7, Docker, Nginx Proxy. The default footer images link wouldn't pull in any of the uploaded logos. Pretty much the problem referenced above. This is with a dedicated chat.domain.com url.

This should be in the docs I guess but the workaround is stunningly easy. After you upload a logo asset the admin panel immediately provides you with a thumbnail image of it. It's not a thumbnail - it's just a scrunched down version of your logo. Bring up a web inspector on that and you see the link is not images but assets.

<img src="/assets/logo.png" />

Or jpg or svg or whatever you uploaded. No idea if you upload xyz.jpg as a logo asset if it is renamed logo.jpg or remains xyz.jpg. No matter, just change the footer image link to just /assets/whatever... and it works great!

EDIT: Note that this flies on the website only. If your users use Android/Windows/Etc. desktop or mobile clients that local call won't work. You'll need to host the asset somewhere and call it completely i.e. https://whatever.com/and_so_on.../thing.jpg

Flitterkill avatar Apr 09 '16 23:04 Flitterkill