You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sep 16 06:47:27 gis uwsgi[3414]: Traceback (most recent call last):
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/local/lib/python2.7/dist-packages/TileStache/__init__.py", line 393, in __call__
Sep 16 06:47:27 gis uwsgi[3414]: status_code, headers, content = requestHandler2(self.config, path_info, query_string, script_name)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/local/lib/python2.7/dist-packages/TileStache/__init__.py", line 266, in requestHandler2
Sep 16 06:47:27 gis uwsgi[3414]: status_code, headers, content = layer.getTileResponse(coord, extension)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/local/lib/python2.7/dist-packages/TileStache/Core.py", line 426, in getTileResponse
Sep 16 06:47:27 gis uwsgi[3414]: tile = self.render(coord, format)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/local/lib/python2.7/dist-packages/TileStache/Core.py", line 513, in render
Sep 16 06:47:27 gis uwsgi[3414]: tile = provider.renderTile(width, height, srs, coord)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/local/lib/python2.7/dist-packages/TileStache/Providers.py", line 266, in renderTile
Sep 16 06:47:27 gis uwsgi[3414]: body = url_opener.open(url, timeout=self.timeout).read()
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/lib/python2.7/urllib2.py", line 435, in open
Sep 16 06:47:27 gis uwsgi[3414]: response = meth(req, response)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
Sep 16 06:47:27 gis uwsgi[3414]: 'http', request, response, code, msg, hdrs)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/lib/python2.7/urllib2.py", line 473, in error
Sep 16 06:47:27 gis uwsgi[3414]: return self._call_chain(*args)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
Sep 16 06:47:27 gis uwsgi[3414]: result = func(*args)
Sep 16 06:47:27 gis uwsgi[3414]: File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
Sep 16 06:47:27 gis uwsgi[3414]: raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
Sep 16 06:47:27 gis uwsgi[3414]: urllib2.HTTPError: HTTP Error 403: Forbidden
I could break it down to missing headers, so I tried with different Referers and User-Agents (see https://operations.osmfoundation.org/policies/tiles/ ) but in the end i could break it down to a missing "Accept" header.
When I add the following line to /usr/local/lib/python2.7/dist-packages/TileStache/Providers.py on line 263 in renderTile function, everything works fine:
It seems, that the accept header is sufficient for OSM.
Any thoughts on this one? How to fix best? Add a field for accept headers in tilestache.cfg or hardcode to renderTile function? Anything else I'm doing wrong, that this issues comes up? Nobody else with this problem?
The text was updated successfully, but these errors were encountered:
thorge
changed the title
HTTP Error 403: Forbidden
OSM Proxy missing Headers - HTTP Error 403: Forbidden
Sep 16, 2019
Hello!
I tried to proxy OSM maps with Tilestache, uWSGI and NGINX.
I encountered the following problem:
I could break it down to missing headers, so I tried with different Referers and User-Agents (see https://operations.osmfoundation.org/policies/tiles/ ) but in the end i could break it down to a missing "Accept" header.
When I add the following line to /usr/local/lib/python2.7/dist-packages/TileStache/Providers.py on line 263 in renderTile function, everything works fine:
It seems, that the accept header is sufficient for OSM.
Any thoughts on this one? How to fix best? Add a field for accept headers in tilestache.cfg or hardcode to renderTile function? Anything else I'm doing wrong, that this issues comes up? Nobody else with this problem?
The text was updated successfully, but these errors were encountered: