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

Top icon link to localhost:5000 when actually its being hosted in a different hostname and behind nginx #2498

Open
goodwill opened this issue Apr 28, 2018 · 5 comments

Comments

@goodwill
Copy link

Issue Summary

The top red chart icon links to 127.0.0.1:5000 when actually its hosted behind proxy, suggest to add ENV setup to allow hostname to be put in.

Technical details:

  • Redash Version: Redash 4.0.0+b3948
  • Browser/OS: All
  • How did you install Redash: docker-compose + nginx on the host machine
@kravets-levko
Copy link
Collaborator

Hi @goodwill! Thank you for reporting this issue. We already know about it, but it's a bit more complicated than just wrong logo link - we have the same issue with embed/share URLs. Currently we're trying to find a solution that will fix URLs for all cases.

@arikfr
Copy link
Member

arikfr commented Apr 28, 2018

@goodwill,

The URL for the icon is generated by the server. The server deduces its address using the Host header. This works fine with proxies as long as your proxy is configured to pass the correct header.

With nginx you need to make sure that you have the following in your config:

proxy_set_header Host $http_host;

@arikfr
Copy link
Member

arikfr commented Apr 28, 2018

@kravets-levko is the issue you're referring is what we had when running with the webpack-dev-server?

@kravets-levko
Copy link
Collaborator

@arikfr Yes, exactly, but it's the same case - webpack-dev-server is a proxy to a backend.

@arikfr
Copy link
Member

arikfr commented Apr 29, 2018

@kravets-levko it happens for the same reason: not setting the Host header correctly. For the webpack-dev-server proxy, we set changeOrigin to true, which means that it will send the destination's hostname as the value of the Host header.

Setting this setting to false will work with a regular usage of the wds proxy (when proxying locally to localhost), and you will see that the URLs are correct (prefixed with localhost:8080). But in most cases it won't work with a remote server, unless it ignores the Host header.

I think we should change this value to false and update the configuration of our dev server to have a default server setup, so it will work with this configuration.

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