Git Product home page Git Product logo

Comments (6)

ellenhp avatar ellenhp commented on May 29, 2024

Hey! Thanks for trying this out! My demo server is currently behind an nginx reverse proxy with HTTPS. https://maps.ellenhp.me/

It seems to only redirect accesses to http://magic_string_magic, but when the whole page is https, also this call will be https://magic_string_magic.

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.

from headway.

RaphMad avatar RaphMad commented on May 29, 2024

I'm using traefik with the following annotations, rest is the very basic example compose file:

    labels:
      - traefik.enable=true
      - traefik.http.routers.headway.rule=Host(`headway.traefik.lan`)
      - traefik.http.routers.headway.entrypoints=https
      - traefik.http.routers.headway.tls=true
      - traefik.http.services.headway.loadbalancer.server.port=8080

(Don't get confused by https and tls=true, thats for talking to the proxy - the communication between traefik and headway then is plain http - I don't think the default headway nginx even exposes https)

from headway.

ellenhp avatar ellenhp commented on May 29, 2024

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?

from headway.

RaphMad avatar RaphMad commented on May 29, 2024

Latest main (6ca45b3 as of now).

Also using Chromium: 102.0.5005.61 (Official Build) (64-bit) if that may be an influence, since the request to https://magic_string_magic is seen in the dev tools and originates from the browser.

from headway.

ellenhp avatar ellenhp commented on May 29, 2024

Okay I think we need to set X-Forwarded-Proto in headway's nginx config. My current theory is that your (outer) reverse proxy is passing through some header indicating protocol that gets propagated all the way to the tileserver-gl-light container. The tileserver is dutifully constructing an https base URL, which means the substitution fails. My outer reverse proxy is stripping the headers when it reconstructs the request, so the protocol appears to be plain HTTP to the tileserver, and substitution succeeds.

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).

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.

from headway.

ellenhp avatar ellenhp commented on May 29, 2024

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.

from headway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.