Error 403r referer is required when using local file on PC to access Openstreetmap tiles
Firefox is stopping access to tiled maps when I access by viewing a local file on the hard drive Chromium/Chrome do not exhibit a similar block.
All Replies (9)
A local file, can you attach it here? so others can try
I cannot currently supply a sample it is part of static website created by the GRAMPS family history program and is in excess of 10gB I will look at creating a single page but it will take time. I will have to use Chromium for the time being because that works as did earlier releases of Firefox I have been in touch with the Openstreetmap community and this is a known problem if however I were to host it on nginx local webserver it would work. Thanks for your response phil
tiled maps ??
lots of maps, geo maps, not ancestry maps
So you can't right click , a map, and copy to desktop etc.
The only way I can do this is by using the Chrome Browser otherwise the map is not visible due to the error message occupying the entire space would this give you the required information. The maps pin point location of buildings ie churches phil
I have used Inspect on the image in Chrome here is an overview if there is anything specific you need please let me know phil
Work round for Firefox not opening local files with OpenStreetMap tiles.
The issue is the Firefox “User Agent” not allowing Referer Policy to work and a solution is to change it for the Chrome User Agent This is only a partial fix because although the map is visible depending on Scrolling In/Out the error message can appear and eventually the map disappear. Implementation Steps
1) CTRL+SHIFT+M takes you to the Responsive Design Mode Alternatively goto More Tools, Responsive Design Mode
Which Displays another MenuBar
2) Goto Settings (Gear Cog between Camera and Close icons right hand end
menubar) Select Show User Agent
3) Click Up/Down Arrows next to UA Custom User Agent Box 4) Select Chrome
You will then have to sort your screen size at left hand end of menubar. This is really all about accommodating mobile phones. Thanks for help phil
In other words, OpenStreetMaps doesn't need any referrer from Chromium user agents, but insists on one from Firefox otherwise responds with denied errors. That sounds like something you'd need to reach out to OpenStreetMaps operators.
(Or, if that's just about your own personal setting, there are addons available to change user agent strings.)
Definitely not an OpenStreetMap issue this is web browser related and depends on their configuration Mozilla are aware and I am guessing their option to use the Chrome Agent is a way of ducking the issue currently and why it is present. phil
Glad they are aware. If you have any bug/compat report handy, please share it here for reference.
Judging from the denied response, they point at these OSM resources:
- https://wiki.openstreetmap.org/wiki/Blocked_tiles
- https://operations.osmfoundation.org/policies/tiles/
Tiles open without a referrer fine if not requested as a subresource. To add the relevant sec-fetch I reproduced by pasting this in the URL mocking a local document:
data:text/html,<img src="https://tile.openstreetmap.org/14/8624/5730.png">
Using default Firefox user agent:
GET /14/8624/5730.png HTTP/2
Host: tile.openstreetmap.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:155.0) Gecko/20100101 Firefox/155.0
Accept: image/avif,image/jxl,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate, br, zstd
Sec-Fetch-Storage-Access: none
Sec-GPC: 1
Connection: keep-alive
Sec-Fetch-Dest: image
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
Priority: u=4, i
HTTP/2 200
server: Varnish
retry-after: 0
cache-control: no-cache
content-type: image/png
access-control-allow-origin: *
access-control-allow-methods: GET, HEAD, OPTIONS
access-control-allow-headers: *
x-blocked: Access denied. See https://operations.osmfoundation.org/policies/tiles/
accept-ranges: bytes
date: Fri, 11 Sep 2026 11:44:55 GMT
via: 1.1 varnish
x-served-by: cache-fra-etou8220163-FRA
x-cache: HIT
x-cache-hits: 0
x-timer: S1789127095.195401,VS0,VE0
x-totp: INVALID
x-totp-int: 901006
x-totp-hmac: 5eDX13b/XoWO3j5UZfEcx/ANzjU=
x-ratelimit: 2
alt-svc: h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
content-length: 6939
X-Firefox-Spdy: h2
While just changing the user agent to fake Chromium and using the same request (i.e. the same sec-fetch headers; so the only difference is the bogus user agent and no functional difference of the browser, pointing at server sniffing: …)
GET /14/8624/5730.png HTTP/2
Host: tile.openstreetmap.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Accept: image/avif,image/jxl,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate, br, zstd
Sec-Fetch-Storage-Access: none
Sec-GPC: 1
Connection: keep-alive
Sec-Fetch-Dest: image
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
Priority: u=4, i
HTTP/2 200
access-control-allow-headers: X-Requested-With
x-tilerender: odin.openstreetmap.org
expires: Fri, 11 Sep 2026 14:06:12 GMT
access-control-allow-origin: *
etag: "a421685a1946e9ecc170e651355561a9"
content-type: image/png
access-control-allow-methods: GET, HEAD, OPTIONS
server: Apache
strict-transport-security: max-age=31536000; includeSubDomains; preload
cache-control: max-age=13368, stale-while-revalidate=604800, stale-if-error=604800
accept-ranges: bytes
date: Fri, 11 Sep 2026 11:40:47 GMT
via: 1.1 varnish
age: 4644
x-served-by: cache-fra-eddf8230115-FRA, cache-fra-etou8220058-FRA
x-cache: MISS, HIT
x-cache-hits: 0, 1
x-timer: S1789126848.828426,VS0,VE2
x-totp: INVALID
x-totp-int: 901006
x-totp-hmac: 5eDX13b/XoWO3j5UZfEcx/ANzjU=
alt-svc: h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
content-length: 20272
X-Firefox-Spdy: h2
the tile is responded with no probs.
This means you have to ask OSM why's that.