An open API service indexing awesome lists of open source software.

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

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
```