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

Sockjs not using CDN_Prefix

Open AlecTroemel opened this issue 9 years ago • 7 comments

Rocket.Chat version: 0.49-develop

Running Rocketchat behind a subdirectory throws errors because Sockjs is using metoers path prefix instead of CDN_Prefix when it is set.

I am running RC at localhost:3000 with CDN_PREFIX set to chat

I am using a simple nginx reverse proxy which looks like this

        location /chat {
            proxy_pass http://127.0.0.1:3000/;
        }    

but seeing this screen shot 2016-12-13 at 10 32 57 am

I've tried a bunch of different things but always seem to hit this.

AlecTroemel avatar Dec 13 '16 16:12 AlecTroemel

Do you also have your site url set? You can set with SITE_URL=yoursite/chat

geekgonecrazy avatar Dec 14 '16 03:12 geekgonecrazy

Hello,

I think there is a link with #4832

julienkoziel avatar Dec 14 '16 09:12 julienkoziel

Same problem here. Rocket.Chat 48.1 in a docker container. The SITE URL is https://delin-build/chat.

If i try to upload a file: image

muus84 avatar Dec 15 '16 15:12 muus84

What I was attempting to do was host my under a different path then what it was served. So for example have the site url be mysite.com/abc and set the cdn_prefix to /xyz so that I could reverse proxy through nginx like this

location /xyz {
   proxy_pass http://mysite.com/abc;
}

For the issue I simplified. I'm skeptical of whether thats even possible, but the concept of the cdn prefix gave me a bit of hope.

AlecTroemel avatar Dec 15 '16 15:12 AlecTroemel

@AlecTroemel wow sounds like a complicated setup. If you're going to try the CDN route.. You might try putting your chat on http://chat.mysite.com and then cdn at mysite.com/chat. With:

location /xyz {
   proxy_pass http://chat.mysite.com;
}

That might be more likely to work

geekgonecrazy avatar Dec 15 '16 16:12 geekgonecrazy

I agree in the complexity, it feels like over engineering. I'm considering now to just create a page with a full iframe of my rocketchat instance at mysite.com/chat. I believe that would bypass my issues altogether

AlecTroemel avatar Dec 15 '16 16:12 AlecTroemel

Did either of those ways work for you? Going to go ahead and close. Please re-open if your problem isn't solved.

geekgonecrazy avatar Dec 19 '16 20:12 geekgonecrazy