-
Notifications
You must be signed in to change notification settings - Fork 62
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
[Bug] Error when hosting behind https reverse proxy #59
Comments
Hey! Thanks for trying this out! My demo server is currently behind an nginx reverse proxy with HTTPS. https://maps.ellenhp.me/
Is your (outer) nginx proxy terminating TLS and then making another HTTPS request out to headway, by any chance? This is very strange, I'm going to go digging. By the way, there seems to be an issue with sprites and fonts at HEAD right now, my demo server is on 5713d71 which is working without issues. |
I'm using traefik with the following annotations, rest is the very basic example compose file:
(Don't get confused by |
It doesn't, but something is convincing the tileserver-gl-light container to think it should serve over https and I don't know what that could be. what Headway commit are you on? |
Latest main (6ca45b3 as of now). Also using |
Okay I think we need to set
I agree that the dummy host is janky but the proof of concept for headway was essentially built in 8 days so there's a bit of that. If you wanted to help with a proper fix for this instead of just a band-aid with the HTTP headers that would be wonderful. My only ask is that I would like to avoid adding redundant environment variables to .env if possible. If you don't have bandwidth I'll get to this eventually! I've been working on #58 though so I haven't had time these last few days. |
This should be fixed by #61. Closing for now but I would eventually like to replace the dummy host with something a bit less janky. |
When hosting behind a reverse proxy using https, tiles cannot be loaded.
I was able to track it down to the
magic_string_magic
dummy host that is defined in https://github.com/headwaymaps/headway/blob/main/web/nginx.conf.template#L53.It seems to only redirect accesses to
http://magic_string_magic
, but when the whole page ishttps
, also this call will behttps://magic_string_magic
.I was able to fix it by manually changing both occurrences of
http://magic_string_magic
tohttps://magic_string_magic
(but of course this only works temporary until the container gets re-created).I think a proper fix would be to have an ENV var defining whether the whole stack is hosted behind https and changing the entries in
nginx.conf.template
accordingly (could maybe even be dynamically parsed from HEADWAY_PUBLIC_URL).The text was updated successfully, but these errors were encountered: