twins/CONFIGURATION.md

1.2 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:
  gemini.rocks:
    -
      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
  twins.rocketnine.space:
    -
      path: /sites
      root: /home/twins/data/sites
    -
      path: /
      root: /home/twins/data/home