-
Notifications
You must be signed in to change notification settings - Fork 7
Generate Caddyfile
Zheng Luo edited this page Feb 16, 2018
·
2 revisions
Since 0.8.0, this project bundles a gen_caddyfile.sh
along with a default template to generate Caddyfile
from config.yaml
, which could be directly used by Caddy web server.
./gen_caddyfile.sh config.yaml outputCaddyfile
Before run, check if there is gomplate
under the same directory with gen_caddyfile.sh
The template iterates over all repos
, and check if it meets given requirements:
Condition worker has name
and path
Effects Generate a route /{{name}}
=> {{path}}
Condition worker has name
and proxy_to
Effects Generate reverse proxy /{{name}}
=> {{proxy_to}}
repos:
- type: rsync
source: rsync://rsync.chiark.greenend.org.uk/ftp/users/sgtatham/putty-website-mirror/
interval: 6
path: /tmp/putty
name: putty # this will generate a route from /putty to /tmp/putty
- type: external
name: ubuntu
proxy_to: http://ftp.sjtu.edu.cn/ubuntu/ # this will generate a route from /ubuntu to http://ftp.sjtu.edu.cn/ubuntu/
The bundled template will generate two additional routes:
lug JSON Restful API.
Reverse proxy to http://lug:7001
Prometheus metrics of Caddy server