https://github.com/hi120ki/caddy-boilerplate
Caddy Boilerplate of Docker
https://github.com/hi120ki/caddy-boilerplate
caddy caddy2 docker letsencrypt
Last synced: 3 months ago
JSON representation
Caddy Boilerplate of Docker
- Host: GitHub
- URL: https://github.com/hi120ki/caddy-boilerplate
- Owner: hi120ki
- License: mit
- Created: 2021-01-15T16:12:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-01T13:51:58.000Z (about 4 years ago)
- Last Synced: 2025-03-21T08:49:04.200Z (7 months ago)
- Topics: caddy, caddy2, docker, letsencrypt
- Language: Makefile
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Caddy Boilerplate
## Quick start
### Run a development server
```
$ make dev
```### Run a production server (with SSL)
You need to set the hostname (domain) in `env/caddy.env` `caddy/prod/Caddyfile` file and add a record (A or AAAA) to the DNS before starting the container.
```
$ cp env/caddy.env.example env/caddy.env
$ nano env/caddy.env
$ make prod
```## Configuration
***Be careful not to refer to the v1 documentation***
### environment variable
```
{$HOST}
``````
{$HOST:localhost}
```### virtual host
```
nginx.example.com {
import default_options
reverse_proxy http://nginx:80 {
import proxy_options
}
}apache.example.com {
import default_options
reverse_proxy http://apache:80 {
import proxy_options
}
}
```### custom header
- set Strict-Transport-Security all path
```
header Strict-Transport-Security max-age=31536000
```- set cache exept `/`
```
header Cache-Control max-age=31536000
header / Cache-Control no-cache
```