azavea / franklin

A STAC/OGC API Features Web Service
https://azavea.github.io/franklin/
Apache License 2.0
76 stars 19 forks source link

Use Host header to build urls #951

Open srstsavage opened 3 years ago

srstsavage commented 3 years ago

Currently urls are built using localhost unless --api-host is explicitly passed. It would be nice if franklin inspected the Host header of incoming requests and used the value (if present) as the domain in the constructed url. This would allow a single franklin instance to be hosted under multiple domain names, among other deployment scenarios.

srstsavage commented 3 years ago

Checking X-Forwarded-Host would be prudent as well

jisantuc commented 3 years ago

Hey @shane-axiom, thanks for the issues! Just a heads up I probably won't be able to get to these until at least two weeks from now since close to 100% of my extra time right now is going toward preparing for a FOSS4G workshop I'm giving. Do you know Scala? If so I'd be happy to a review a PR that makes this change. Also feel free to drop by the Gitter channel if you run into any trouble

srstsavage commented 3 years ago

No worries, I'm not blocked on these particular issues, they're more nice-to-have/best practices kind of requests. Appreciate the response and the project!