Closed papaya147 closed 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:
ProxyPassReverse
of mod_proxy
can change paths in the HTTP headers (e.g. to fix paths in redirects). But that won't help with the hardcoded path in the HTML.ProxyHTMLURLMap
of mod_proxy_html
allows to change links in HTML responses, but as far as I see that is limited to specific HTML tags like <a>
, so it won't help you here where it is inside of a <script>
.Substitute
of mod_substitute
is likely more suited fot that, by being able to define a regex replacement rule for the response body. Substitute "s|/tile/|/overv/tile/|"
Not sure how to deal with this problem with other proxy software, but there likely are options for this.
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?