Skip to content
/ caddy-template Public template

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

License

Notifications You must be signed in to change notification settings

F3Joule/caddy-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Languages