aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-11-11 14:54:15 +0100
committermetamuffin <metamuffin@disroot.org>2024-11-11 14:54:15 +0100
commitef1ed0beb17649e7c65eee7081c605282bae8111 (patch)
tree7ac8d4bfda1a77e2e0ea5bb69f60bf16d2bf7fec /readme.md
parenta559aaf12f9b57ef1a1d440011e874e2c8d4f954 (diff)
downloadgnix-ef1ed0beb17649e7c65eee7081c605282bae8111.tar
gnix-ef1ed0beb17649e7c65eee7081c605282bae8111.tar.bz2
gnix-ef1ed0beb17649e7c65eee7081c605282bae8111.tar.zst
paths rest capture group
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md22
1 files changed, 13 insertions, 9 deletions
diff --git a/readme.md b/readme.md
index 4817493..53f54f5 100644
--- a/readme.md
+++ b/readme.md
@@ -58,7 +58,8 @@ handler: !hosts
## Reference
The configuration uses YAML formatting. When the configuration file is changed,
-it will automatically be loaded and applied if valid.
+it will automatically be loaded and applied if valid. Configuration errors are
+reported in stderr and are only fatal at startup.
- **section `http`**
- Optional section. Omit to disable unencrypted http.
@@ -86,7 +87,7 @@ it will automatically be loaded and applied if valid.
connections. excess connections are rejected. Default: 256
- **section `handler`**
- - A module to handle all requests. Usually an instance of `hosts`.
+ - A module to handle all requests. Usually an instance of `hosts` or `paths`.
- `watch_config`: boolean if to watch the configuration file for changes and
apply them accordingly. Default: true (Note: This will watch the entire parent
@@ -103,14 +104,17 @@ themselves; in that case the request is passed on.
- Takes a map from hostname (string) to handler (module)
- **module `paths`**
- - Routes requests by matching the path against regexes.
- - Takes a map from a global regex that is applied to the path (string) to
- handler (module)
+ - Routes requests by matching the path against regexes. The first matching
+ regex determines the module to handle this request. If the regex has an
+ unnamed capture group, its value will become the downstream request URI.
+ - Takes a map from regex (string) to handler (module) OR a sequence of such
+ maps. The priority is assigned first by position in the sequence then
+ alphabetically in the map.
- **module `proxy`**
- Forwards the request as-is to some other server. the `x-real-ip` header is
- injected into the request. Connection upgrades are handled by direct
- forwarding of network traffic.
+ added to the request. Connection upgrades are handled by direct forwarding
+ of network traffic.
- `backend`: socket address (string) to the backend server
- **module `files`**
@@ -127,8 +131,8 @@ themselves; in that case the request is passed on.
- **module `file`**
- Replies with static content.
- - `path`: file path to the content. _This will be loaded into memory once!_
- (string)
+ - `path`: file path to the content. _This will be loaded into memory at
+ startup!_ (string)
- `content`: inline declaration of the content. (string)
- `type`: type of content reflected in `content-type` header. (string)