aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-06 19:05:40 +0000
committerOmar Polo <op@omarpolo.com>2021-02-06 19:05:40 +0000
commit1487e11edab233a7c4a84e87d4e2182519c7f1be (patch)
tree28cf7545b6c53f410c9059932e221fd3d01b3682 /README.md
parent2b92a4477a693e92320edf6bdebf6fae81a73091 (diff)
drop sample.conf and add something to the README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/README.md b/README.md
index 29cc6bc..9d595cf 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,50 @@ The only missing piece is UNICODE normalisation of the IRI path: gmid
doesn't do that (yet).
+## Configuration
+
+gmid has a rich configuration file, heavily inspired by OpenBSD'
+httpd. While you should definitely check the manpage because it
+documents every option in depth, here's an example of what gmid can
+do.
+
+```conf
+ipv6 on # enable ipv6
+
+server "example.com" {
+ cert "/path/to/cert.pem"
+ key "/path/to/key.pem"
+ root "/var/gemini/example.com"
+ lang "it"
+ cgi "/cgi/*"
+
+ location "/files/*" {
+ auto index on
+ }
+
+ location "/repo/*" {
+ # change the index file name
+ index "README.gmi"
+ }
+
+ # redirect /cgi/man/... to man.example.com/...
+ location "/cgi/man*" {
+ strip 2
+ block return 31 "gemini://man.example.com%p"
+ }
+}
+
+server "man.example.com" {
+ cert "..."
+ key "..."
+ root "/var/gemini/man.example.com"
+
+ # handle every request with the CGI script `man'
+ entrypoint "man"
+}
+```
+
+
## Building
gmid depends on a POSIX libc, OpenSSL/LibreSSL and libtls (provided