-
I've tried to set up Martin with nginx as a reverse proxy for caching tiles and fonts. The current situation is that the tiles are served correctly from my server. But when the maplibre client tries to request a font, nginx returns HTTP 400. I've already checked that my map styles point to correct URLs. I've also tried the font URLs locally using curl. Direct requests to Martin seem to work while request via nginx do not. For nginx I'm using the example configuration file from https://github.com/maplibre/martin/blob/main/demo/frontend/nginx.conf with minor modifications to allow for CORS. $ martin --version Martin debug log (related rows): |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is clearly an nginx issue, and I suspect this is due to a space in the URL. Your nginx setup doesn't seem to be escaping that space, and thus the HTTP parser is having issues parsing the request. |
Beta Was this translation helpful? Give feedback.
-
Martin example configuration : location ~ /tiles/(?<fwd_path>.*) {
proxy_set_header X-Rewrite-URL $uri;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_pass http://martin:3000/$fwd_path$is_args$args;
} can be rewritten as: location /tiles/ {
....
proxy_pass http://martin:3000/;
}
|
Beta Was this translation helpful? Give feedback.
This is clearly an nginx issue, and I suspect this is due to a space in the URL. Your nginx setup doesn't seem to be escaping that space, and thus the HTTP parser is having issues parsing the request.