twins-upstream/CONFIGURATION.md
Trevor Slocum 8aec55c459 Support multiple hostnames
Resolves #1.
2020-10-30 13:30:09 -07:00

1.3 KiB

Paths may be defined as fixed strings or regular expressions (starting with ^).

Fixed string paths will match with and without a trailing slash.

Serve entries have either a root path or proxy URL. When a root path is provided static files and directories are served from that location. When a proxy URL is provided requests are forwarded to the Gemini server at that URL.

Paths are matched in the order they are provided.

When accessing a directory index.gemini or index.gmi is served.

config.yaml

# Address to listen on
listen: 0.0.0.0:1965

# TLS certificates
certificates:
  -
    cert: /home/gemini.rocks/data/cert.crt
    key: /home/gemini.rocks/data/cert.key

# Hosts and paths to serve
hosts:
  -
    name: gemini.rocks
    paths:
      -
        path: /sites
        root: /home/gemini.rocks/data/sites
      -
        path: ^/(help|info)$
        root: /home/gemini.rocks/data/help
      -
        path: ^/proxy-example$
        proxy: gemini://localhost:1966
      -
        path: ^/cmd-example$
        command: uname -a
      -
        path: /
        root: /home/gemini.rocks/data/home
  -
    name: twins.rocketnine.space
    paths:
      -
        path: /sites
        root: /home/twins/data/sites
      -
        path: /
        root: /home/twins/data/home