This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Nginx upstream results in :Fastly error: unknown domain

0

I have a local server. I tried to cache/balance Openstreetmap very simple as you see in bellow:

upstream osm {                           
server  a.tile.openstreetmap.org;
server  b.tile.openstreetmap.org;
server  c.tile.openstreetmap.org;
}

server {
listen        80;
server_name     *.192.168.29.132  192.168.29.132;

   location /myosm/ {
     proxy_pass http://osm;
   }
}

Good to say that I can use upstream for any internal servers correctly like this :

upstream my_servers {                           
 server  192.168.29.100;
 server  192.168.29.101;
}

But I have problem with openstreetmap servers. Any hint is appreciable.

Error is :

Fastly error: unknown domain: osm. Please check that this domain has been added to a service.

Details: cache-fra19124-FRA

asked 12 Apr '21, 10:26

Ehsan_1362's gravatar image

Ehsan_1362
21224
accept rate: 0%


One Answer:

3

You are sending a host header value of "osm" upstream. That won't work with fastly.

So try adding a

proxy_set_header Host tile.openstreetmap.org;

to the proxy location directive.

Please also note the tile usage policy that you'll have to follow: https://operations.osmfoundation.org/policies/tiles/

answered 12 Apr '21, 11:18

Spiekerooger's gravatar image

Spiekerooger
3.1k22356
accept rate: 16%

edited 12 Apr '21, 11:20

1

Thanks for replying. Installing a fresh Nginx, adding

proxy_set_header Host tile.openstreetmap.org;

and finally changing this :

proxy_pass http://osm;

to this:

proxy_pass http://osm/;

saved me.

(12 Apr '21, 12:34) Ehsan_1362

Source code available on GitHub .