CGI
Calls out to an external CGI executable, such as MapServer, to generate the tile.
Description
This provider allows tilegroxy to act as the HTTP server for a CGI program like Apache httpd or nginx traditionally acts. The flagship use-case for this is to integrate with MapServer. A full example is available in examples/mapserver.
Example
-
YAML
-
JSON
provider:
name: cgi
exec: /usr/bin/mapserv
uri: "/?map=mapfiles/roads.map&MODE=tile&layers=all&TILEMODE=gmap&TILE={x}+{y}+{z}"
workingDir: /etc/mapserver
env:
MAPSERVER_CONFIG_FILE: mapserver.conf
{
"provider": {
"name": "cgi",
"exec": "/usr/bin/mapserv",
"uri": "/?map=mapfiles/roads.map&MODE=tile&layers=all&TILEMODE=gmap&TILE={x}+{y}+{z}",
"workingDir": "/etc/mapserver",
"env": {
"MAPSERVER_CONFIG_FILE": "mapserver.conf"
}
}
}
Configuration
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
The path to the CGI executable |
string |
Yes |
None |
|
Arguments to pass into the executable in standard "split on spaces" format |
string[] |
No |
None |
|
The URI (path + query) to pass into the CGI for the fake request - think mod_rewrite style invocation of the CGI |
string |
Yes |
None |
|
The host to pass into the CGI for the fake request |
string |
No |
localhost |
|
Extra headers to pass into the CGI with the request |
map[string][]string |
No |
None |
|
Extra environment variables to supply to the CGI invocations. Variable names are converted to uppercase. If the value is an empty string it passes along the value from the main tilegroxy invocation |
map[string]string |
No |
None |
|
Working directory for the CGI invocation |
string |
No |
Base dir of exec |
|
If true, if the CGI response includes a content type that isn’t in the Client's list of acceptable content types then it treats the response body as an error message |
bool |
No |
false |