maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.16k stars 625 forks source link

maptiler-server & nginx proxy to a URL with sub-folder #1103

Open wxrl opened 8 months ago

wxrl commented 8 months ago

OS: Debian 12 with nginx 1.22.1 Maptiler: maptiler-server 4.4.0 directly installed with .deb package

After installation I can proxy http://127.0.0.1:3650 to http:// or https://xxx.mydomain.com but kept failing to proxy it to https://xxx.mydomain.com/map

There are some parameters I found here baseurl and public_url, neither of them worked no matter I used them in the maptiler-server execution command or in the config.json. Could anyone suggest? Thanks.

acalcutt commented 8 months ago

Maptiler-server is a different product by maptiler. This is tileserver-gl, a open source tileserver.

For tileserver-gl you should be following the documentation at https://maptiler-tileserver.readthedocs.io/ . For one, the default port tileserver-gl runs on is 8080, not 3650

vasily-polonsky commented 8 months ago

Hi @acalcutt I am facing the same issue while working with tileserver-gl-light. I tried options from the help command (-u|--public_url to enable exposing the server on subpaths, not necessarily at the domain's root). However, they haven't worked for me. I've also tried different variations from the documentation at https://maptiler-tileserver.readthedocs.io/, but with no luck. Is there an example available on how to run it not on the root directory?

wxrl commented 8 months ago

Maptiler-server is a different product by maptiler. This is tileserver-gl, a open source tileserver.

For tileserver-gl you should be following the documentation at https://maptiler-tileserver.readthedocs.io/ . For one, the default port tileserver-gl runs on is 8080, not 3650

Sorry for the wrong place... I couldn't find the maptiler-server repo under maptiler github, so I thought there might be someone who could help here. Again sorry for the intruding.

RadekDvorak commented 4 weeks ago

What I do to inject a path prefix into tileserver-gl is append it to the Host header. It is not validated in any way. The header is manipulated by an nginx proxy on the way to the tileserver-gl.

There has been a X-Forwarded-Path header support added in v4.11.0 which I am yet to investigate as a proper replacement.