F3Joule / caddy-template

A Docker containered Caddy server template with a bash script to simplify startup process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Containered Caddy template

A Docker containered Caddy server template with a bash script to simplify startup process.

Prerequisites

You should have installed Docker and Docker-compose to continue with this repo.

How to

Example

Template Caddyfile:

:80 {
  route /api/* {
    uri strip_prefix /api
    reverse_proxy localhost:3001
  }

  reverse_proxy localhost:3000
}

Line-by-line explanation:

  • Listen on port 80.
  • Open route rules block on every /api request:
    • Strip /api
    • Proxy the request to localhost:3001
  • Close route rules block.
  • Proxy all other requests to localhost:3000

About

A Docker containered Caddy server template with a bash script to simplify startup process.

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%