-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf.example
40 lines (32 loc) · 1.19 KB
/
nginx.conf.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
worker_processes 1;
error_log stderr notice;
daemon off;
events { }
http {
lua_package_path "/path/to/chickpea/lib/?.lua;;";
server {
listen 8080;
set $cacheroot "/path/to/chickpea/cache/"; # note trailing slash
root $cacheroot;
# serve tiles if not in the cache
location @tileserver {
set $mapnik_clib "/path/to/chickpea/clib"
set $mapnik_datasource "/usr/local/lib/mapnik/input";
content_by_lua_file "/path/to/chickpea/serve_image.lua";
}
# capture tile request e.g. /tile/l8/091080/rgb/20160924/10/938/597.jpg
# regex named capture groups for each param
# multiple locations can be defined
location ~ ^/tile/(?<layer>[^/]+)/(?<pathrow>[^/]+)/(?<type>[^/]+)/(?<date>[^/]+)/(?<z>[^/]+)/(?<x>[^/]+)/(?<y>[^.]+) {
set $xmlroot "/path/to/chickpea/sample/";
set $xmlpath "${layer}_${type}_$pathrow$date.xml";
set $cachepath "$layer/$pathrow/$type/$date/$z/$x/$y.jpg";
try_files $cachepath @tileserver;
}
# root page
location / {
default_type text/plain;
echo "Chickpea bellows hello";
}
}
}