mod_tile icon indicating copy to clipboard operation
mod_tile copied to clipboard

ModTileEnableTileThrottlingXForward=1 seems to block proxy requests

Open jocelynj opened this issue 11 years ago • 1 comments

When configuring a tile server with ModTileEnableTileThrottlingXForward=1, I didn't get any answer when using X-Forwarded-for, but the same request without this header worked correctly. As soon as I changed the server configuration to ModTileEnableTileThrottlingXForward=0, the request worked correctly.

$ curl -v -H "Via: 1.1 guenievre (squid/3.3.8)" -H "Cache-Control: max-age=259200" -H "Connection: keep-alive" -A "Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 Iceweasel/29.0.1" -e "http://tile.openstreetmap.fr/" -H "DNT: 1" -H "Accept: image/png,image/*;q=0.8,*/*;q=0.5" -H "Accept-Language: fr-fr,chrome://global/locale/intl.properties;q=0.5" -H "Accept-Encoding: gzip, deflate" -H "X-Forwarded-For: 10.1.2.22" http://a.tile.openstreetmap.fr/osmfr/6/32/25.png >/dev/null
* Hostname was NOT found in DNS cache
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 2a01:e0d:1:c:58bf:fac1:0:13...
* Connected to a.tile.openstreetmap.fr (2a01:e0d:1:c:58bf:fac1:0:13) port 80 (#0)
> GET /osmfr/6/32/25.png HTTP/1.1
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 Iceweasel/29.0.1
> Host: a.tile.openstreetmap.fr
> Referer: http://tile.openstreetmap.fr/
> Via: 1.1 guenievre (squid/3.3.8)
> Cache-Control: max-age=259200
> Connection: keep-alive
> DNT: 1
> Accept: image/png,image/*;q=0.8,*/*;q=0.5
> Accept-Language: fr-fr,chrome://global/locale/intl.properties;q=0.5
> Accept-Encoding: gzip, deflate
> X-Forwarded-For: 10.1.2.22
> 
* Empty reply from server
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host a.tile.openstreetmap.fr left intact
curl: (52) Empty reply from server

jocelynj avatar May 27 '14 17:05 jocelynj

I think mod_tile should reply with status 429 Too many requests with Retry-After header if throttling bucket is full for a user instead of just closing the connection.

hobgoblinsmaster avatar May 28 '14 06:05 hobgoblinsmaster