drop sample.conf and add something to the README.md

This commit is contained in:
Omar Polo 2021-02-06 19:05:40 +00:00
parent 2b92a4477a
commit 1487e11eda
2 changed files with 44 additions and 42 deletions

View File

@ -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

View File

@ -1,42 +0,0 @@
ipv6 on # enable ipv6
# decomment to allow only TLSv1.3
#protocols "tlsv1.3"
# add the mapping for the extension rtf to the MIME application/rtf
mime "application/rtf" "rtf"
# server block example
server "example.com" {
cert "/path/to/cert.pem"
key "/path/to/key.pem"
root "/var/gemini/example.com"
}
server "it.example.com" {
cert "/path/to/cert.pem"
key "/path/to/key.pem"
root "/var/gemini/example.com"
# enable CGI scripts in /cgi-bin/
cgi "/cgi-bin/*"
# optional
lang "it"
}
# a server block with a location
server "foo.com" {
cert "..."
key "..."
root "..."
location "/it/" {
lang "it"
}
location "/files" {
lang "en"
auto index on
}
}