Mercurial Hosting > d2o
comparison man/d2obase.5.md @ 11:350589d762a0 default tip
add cgi, remove tls, update docs
| author | Atarwn Gard <a@qwa.su> |
|---|---|
| date | Thu, 19 Mar 2026 20:00:49 +0500 |
| parents | 54ab94198677 |
| children |
comparison
equal
deleted
inserted
replaced
| 10:560d4103e12e | 11:350589d762a0 |
|---|---|
| 78 ## Listening | 78 ## Listening |
| 79 | 79 |
| 80 **port** *number* | 80 **port** *number* |
| 81 : Listen for plain HTTP on the given port. | 81 : Listen for plain HTTP on the given port. |
| 82 | 82 |
| 83 **port+tls** *number* [*cert* *key*] | 83 **port+tls** *number* *cert* *key* |
| 84 : Listen for HTTPS on the given port. Certificate and key paths are optional if a **tls** directive is present in the same block. | 84 : Listen for HTTPS on the given port. Certificate and key paths are required. |
| 85 | |
| 86 **tls** *cert* *key* | |
| 87 : Set the default certificate and key for **port+tls** directives in this block that do not specify their own paths. | |
| 88 | 85 |
| 89 ## Serving | 86 ## Serving |
| 90 | 87 |
| 91 **root** *path* [**show**] | 88 **root** *path* [**show**] |
| 92 : Serve static files from *path*. Without **show**, directory listing is forbidden (403). With **show**, an HTML directory listing is returned. | 89 : Serve static files from *path*. Without **show**, directory listing is forbidden (403). With **show**, an HTML directory listing is returned. |
| 93 | 90 |
| 94 **ndex** *file...* | 91 **ndex** *file...* |
| 95 : List of index filenames to try when a directory is requested, checked left to right. If a matching file passes the **fcgi** pattern, it is handled by FastCGI instead of served directly. | 92 : List of index filenames to try when a directory is requested, checked left to right. If a matching file passes the **fcgi** or **cgi** pattern, it is handled accordingly instead of served directly. |
| 96 | 93 |
| 97 **fcgi** *address* [*pattern*] | 94 **fcgi** *address* [*pattern*] |
| 98 : Forward matching requests to a FastCGI server. *address* is either `unix:///path/to/socket` or `host:port`. *pattern* is a glob matched against the request path (default `*`). When used together with **root**, only requests matching the pattern are forwarded; everything else is served as static. | 95 : Forward matching requests to a FastCGI server. *address* is either `unix:///path/to/socket` or `host:port`. *pattern* is a glob matched against the request path (default `*`). When used together with **root**, only requests matching the pattern are forwarded; everything else is served as static. |
| 96 | |
| 97 **cgi** *executable* [*pattern*] | |
| 98 : Run *executable* as a CGI program for matching requests. *pattern* is a glob matched against the request path (default `*`). The executable is invoked per-request with standard CGI environment variables (`REQUEST_METHOD`, `QUERY_STRING`, `PATH_INFO`, etc.). When used together with **root**, only requests matching the pattern are handled by CGI; everything else is served as static. Useful for simple CGI programs such as **cgit**(1). | |
| 99 | 99 |
| 100 **rprx** *address* | 100 **rprx** *address* |
| 101 : Reverse-proxy all requests to *address*. The `http://` scheme is assumed if not specified. | 101 : Reverse-proxy all requests to *address*. The `http://` scheme is assumed if not specified. |
| 102 | 102 |
| 103 **rdir** *code* *url* | 103 **rdir** *code* *url* |
| 148 $DOM | 148 $DOM |
| 149 |> port 80 | 149 |> port 80 |
| 150 |> port+tls 443 $TLS.{crt,key} | 150 |> port+tls 443 $TLS.{crt,key} |
| 151 |> root $WWW show | 151 |> root $WWW show |
| 152 | 152 |
| 153 A minimal setup with cgit: | |
| 154 | |
| 155 git.example.org | |
| 156 |> port 80 | |
| 157 |> port+tls 443 /etc/acme/git.example.org.{crt,key} | |
| 158 |> root /usr/share/cgit | |
| 159 |> ndex cgit.cgi | |
| 160 |> cgi /usr/lib/cgit/cgit.cgi *.cgi | |
| 161 | |
| 153 # CAVEATS | 162 # CAVEATS |
| 154 1. ICF does not support strings with spaces - there are **no quotes or escapes**. Every character except space is treated as part of a token, including `!`, `*`, `/`, and so on. Glob patterns passed to **fcgi** are forwarded as-is to the server. | 163 1. ICF does not support strings with spaces - there are **no quotes or escapes**. Every character except space is treated as part of a token, including `!`, `*`, `/`, and so on. Glob patterns passed to **fcgi** and **cgi** are forwarded as-is to the server. |
| 155 | 164 |
| 156 2. Variables are evaluated top-down at the point of declaration. Forward references do not work: if `B=$A` appears before `A=value`, `B` will contain the literal `$A`. | 165 2. Variables are evaluated top-down at the point of declaration. Forward references do not work: if `B=$A` appears before `A=value`, `B` will contain the literal `$A`. |
| 157 | 166 |
| 158 3. Only one pair of curly braces is expanded per argument. `file.{a,b}.{x,y}` does not produce four arguments - only the first `{}` pair is expanded. | 167 3. Only one pair of curly braces is expanded per argument. `file.{a,b}.{x,y}` does not produce four arguments - only the first `{}` pair is expanded. |
| 159 | 168 |
