I'm looking to proxy mapquest OSM tiles so I can serve them to my users via SSL. This is what my nginx config looks like:
upstream maptile_server {
server otile1.mqcdn.com;
server otile2.mqcdn.com;
server otile3.mqcdn.com;
server otile4.mqcdn.com;
}
server {
# ...
server_name app.example.com;
location /tiles {
proxy_pass http://maptile_server;
}
}
So if a map tile exists at http://otile1.mqcdn.com/tiles/1.0.0/osm/14/3678/6230.png, I want to access it at https://app.example.com/tiles/1.0.0/osm/14/3678/6230.png.
Currently I'm getting an "Invalid URL" error.
EDIT:
I also considered doing something like this:
location ~ /maptiles/(?<subdomain>.+)/(?<z>.+)/(?<x>.+)/(?<y>.+) {
return http://$subdomain.mqcdn.com/tiles/1.0.0/osm/$z/$x/$y;
}
But this redirects me to the final url rather than proxying the request. Is there any way to hide the final URL from the client?