Overv / openstreetmap-tile-server

Docker file for a minimal effort OpenStreetMap tile server
Apache License 2.0
1.2k stars 482 forks source link

Tile fetching behind reverse proxy #414

Closed papaya147 closed 5 months ago

papaya147 commented 5 months ago

I've deployed this container on a Kubernetes cluster. I am connecting a service to my ingress to proxy to this container. I am able to access the http service at domain.com/overv. But when tiles are trying to be loaded, it's trying to fetch tiles from domain.com/tiles/..., whereas I want it to fetch from domain.com/overv/tiles/... . Is there any way to let the container know it's behind a reverse proxy?

Istador commented 5 months ago

The problem is, that the absolute path is hardcoded. https://github.com/Overv/openstreetmap-tile-server/blob/6088b9b37f440f141f643f413a3d6454a1c01aa2/leaflet-demo.html#L28

You could volume mount your own .html file over /var/www/html/index.html that changes the path.


If you are using apache as the proxy, there are settings that might be able to deal with these kind of problems:

Not sure how to deal with this problem with other proxy software, but there likely are options for this.