Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images won't display if Rocket.Chat is running behind an nginx reverse proxy #517

Closed
dkoryavov opened this issue Aug 21, 2017 · 4 comments
Closed

Comments

@dkoryavov
Copy link

Hello,

Our Rocket.Chat installation is running behind nginx reverse proxy. Config:

location /rocket {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://[our_rocket_node]/rocket;

}

With this configuration images just won't display:

image

But I can see the same image in any web browser. Thus, I believe that this is a problem of the desktop app.

Tested on:
Windows 7 and Ubuntu 16.04
Rocket.Chat client 2.8.0.
Rocket.Chat Server 0.58.1.

@dkoryavov
Copy link
Author

Tested a little more. I have the same problem if I trying to connect to the our Rocket.Chat installation directly. Is looks like Rocket.Chat desktop app does not work if server is running just under context.

@bennlich
Copy link

bennlich commented Mar 13, 2018

I'm having the same issue. My rocket chat server is running behind an nginx proxy with ROOT_URL=https://my.domain/chat/. Images load correctly on the web client. Surprisingly, the urls it uses are like:

/chat/chat/file-upload/nmJDQ5v5BY7BeHjrc/he.png

(yes, the double /chat/chat works).

Images do not load on the desktop client. It seems to make requests to paths like

/chat/file-upload/nmJDQ5v5BY7BeHjrc/he.png

which seem more reasonable to me, but do not work.

This issue seems related to RocketChat/Rocket.Chat#2646.

Versions:
Server 0.61.0
Desktop Client 2.10.5

@bennlich
Copy link

bennlich commented Mar 14, 2018

The duplicate path I'm seeing seems related to RocketChat/Rocket.Chat#10029. I'm still stumped about why the duplicate path works though, and the non-duplicate path fails.

EDIT: Oh I think I see now. I think the PR I linked fixes the path duplication on both the server side and on the web client side. It seems like the desktop client I am using is already "fixed" in that it makes requests to the unduplicated path, but my server is behind and does not have the needed fix. So the desktop client appears broken, but really it's just waiting for my server to be fixed :-P

@dkoryavov
Copy link
Author

It seems the bug has been fixed in Rocket.Chat 0.63.3, I can see all images. Thus, I close the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants