The configuration file is a simple text file that contains the configuration of the server. It is composed of a series of directives, each directive is on a single line. A directive starts with a keyword, followed by arguments.
The configuration file must be in YAML.
Server Mandatory | ||
---|---|---|
Key | Type | Value |
server_name | string | name to connect to the server |
address IP | string | server ip address |
port | int | port where the server will receive the requests |
Server Content | ||
routes | map<string, string> | map of all routes replace/path |
Default values for all routes (can be redefine individually) | ||
root | string | Root path of the server |
index | string | Names of the index file for all routes |
max_body_size | int | Max length for client body size |
error_page | string | Path to default error page |
allowed_methods | Array | Allowed http methods for all routes |
cgi_bin | string | Path to CGI executable file for all routes |
directory_listing | bool | On/off directory listing |
cgi_extensions | array | File extensions where CGI will be executed |
upload_dir | string | Path to save uploaded file from all routes |
Route content | ||
route_path | array | Path of this route |
root | string | Redefine the root for this route |
max_body_size | int | Redefine max length for client body size for this route |
index | string | names of the index file for this routes |
allowed_methods | Array | Allowed http methods for this route |
cgi_bin | string | Path to CGI executable file for this route |
cgi_extensions | array | File extensions where CGI will be executed |
upload_dir | string | Path to save uploaded file for this route |
Here's some docs for YAML
https://learn.getgrav.org/16/advanced/yaml Basic YAML syntax introduction