Site config file
planejadoPlanejado para o WardPane 2.1. Este recurso não está na versão atual; a página descreve como ele deve funcionar. Roteiro
Besides the forms, every site in WardPane 2.1 will have its own config file written in a syntax close to nginx. The file and the forms show the same settings. A field changed in a form appears in the file, and an edit to the file shows up in the forms.
The file is for people who prefer text. The whole setup of a site is in one place, a block can be copied from one site to another, and a change can be reviewed before saving. Anyone happy with the forms can ignore the file.
Editing the file
Open the site and switch to its config file view in the panel (in Expert mode). The editor checks the file when you save it:
- every error is reported with its line number and a short reason, and nothing is applied until the whole file is valid;
- an unknown directive or a value out of range counts as an error and is reported like any other;
- the panel keeps a history of versions, so you can see what changed and go back to an earlier version.
A file saved in the panel goes through the same path as a form, since both edit one set of settings. The same checks run, and the root helper validates the result again before it changes anything that needs root.
What the file covers
| Area | Directives (overview) |
|---|---|
| The site | server_name (domain and aliases), handler (static, PHP or Node.js) |
| Requests | max_body_size, timeouts |
| Compression | gzip, brotli |
| Logs | access_log with a format and rotation, error_log |
| Responses | header, expires, CORS |
| Paths | location blocks with allow and deny, password protection, a proxy to a local port, timeouts and a fallback |
| URLs | redirect and rewrite |
| Protection | the protection settings of the site (rate limit, Bot Fight, geo rules, link-only access and the rest) as directives |
Examples
The examples below only illustrate the style of the file. Directive names and values follow nginx where that fits; the exact names and arguments will be in the directive reference.
A static site with compression, caching and a security header:
server_name example.com www.example.com;
handler static;
gzip on;
brotli on;
expires /assets/ 30d;
header X-Frame-Options SAMEORIGIN;
A PHP site with a private admin folder and a larger upload limit:
server_name shop.example.net www.shop.example.net;
handler php;
max_body_size 64m;
location /admin/ {
allow 203.0.113.0/24;
deny all;
}
redirect /old-catalog/ /catalog/ 301;
A Node.js app with an API that other sites may call, and a separate service on a local port:
server_name booking.example.com;
handler node;
location /api/ {
cors https://www.example.com;
}
location /reports/ {
proxy 127.0.0.1:10050;
timeout 120s;
}
access_log combined rotate=daily keep=14;
Directive reference
The full list of directives, with their arguments, defaults and limits, is generated from the panel’s own schema and will come with WardPane 2.1. Until then, every setting the file can hold is described by the forms in the panel and by the pages on protection, PHP, Node.js and .htaccess.