ubuntuにmapcache、mapserver(WMS)、nginxがあります。私の指示:
http://mapserver.org/id/mapcache/install.html#cgi-fastcgi-specific-instructions
Nginx *.conf:
location ~ ^/maps/ofp_10000(?<path_info>/.*|$) {
set $url_prefix "/maps/ofp_10000";
mapcache /mapcache/ofp.xml;
error_page 404 = @fastcgi_mapcache;
}
location @fastcgi_mapcache {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index mapserv;
fastcgi_param QUERY_STRING map=/ofp_10000/vrt_all.map&$query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_NAME "/maps/ofp_10000";
}
ofp.xml:
<mapcache>
<cache name="tmp1" type="disk" layout="template">
<template>/tmp/mapcache/{tileset}#{grid}#{dim}/{z}/{x}/{y}.{ext}</template>
</cache>
<source name="vmap0" type="wms">
<getmap>
<params>
<FORMAT>image/jpeg</FORMAT>
<LAYERS>vrt_all</LAYERS>
</params>
</getmap>
<http>
<url>http://host/maps/ofp_10000?</url>
</http>
</source>
<tileset name="vrt_all">
<source>vmap0</source>
<cache>tmp1</cache>
<grid>WGS84</grid>
<grid>g</grid>
<format>JPEG</format>
<metatile>2 2</metatile>
<metabuffer>10</metabuffer>
<expires>10000</expires>
<auto_expire>86400</auto_expire>
</tileset>
<default_format>JPEG</default_format>
<service type="wms" enabled="true">
<full_wms>assemble</full_wms>
<resample_mode>bilinear</resample_mode>
<format>JPEG</format>
<maxsize>4096</maxsize>
</service>
<service type="wmts" enabled="true"/>
<service type="tms" enabled="true"/>
<service type="kml" enabled="true"/>
<service type="gmaps" enabled="true"/>
<service type="ve" enabled="true"/>
<service type="mapguide" enabled="true"/>
<service type="demo" enabled="true"/>
<errors>report</errors>
<log_level>warn</log_level>
<lock_retry>10000</lock_retry>
<lock_dir>/tmp</lock_dir>
<auto_reload>false</auto_reload>
</mapcache>
の
http://host/maps/ofp_10000/demo/wms
私の WMS は正常に動作していますが、キャッシュはしていません - /tmp/mapcache は空です。
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx