Skip to content

Commit 7a5529a

Browse files
docs(faq): Add caddy reverse proxy guide
1 parent e9d6605 commit 7a5529a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/FAQ.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,53 @@ hide:
241241
- traefik.http.services.foo.loadbalancer.serverstransport=ignorecert@file
242242
- traefik.http.services.foo.loadbalancer.server.scheme=https
243243
```
244+
245+
=== "Caddy"
244246

247+
When reverse proxying an HTTPS backend that uses a self-signed certificate, Caddy will normally reject it because it cannot verify the certificate authority.
248+
249+
To skip this verification we can modify site entry of the [caddyfile](https://caddyserver.com/docs/quick-starts/caddyfile) as shown below:
250+
251+
*Note: replace `calibre.xxx.com` with your domain and `172.xxx.xxx.xxx:8181` with your backend service IP and port.*
252+
253+
```caddyfile
254+
calibre.xxx.com {
255+
reverse_proxy https://172.xxx.xxx.xxx:8181 {
256+
transport http {
257+
tls
258+
tls_insecure_skip_verify
259+
}
260+
}
261+
}
262+
```
263+
264+
**Bonus Tip 1**: If you find yourself needing to do this for multiple services, you can also define a [caddy snippet](https://caddyserver.com/docs/caddyfile/concepts#snippets) and reuse it in your caddyfile like so:
265+
266+
```caddyfile
267+
(allow_insecure_ssl) {
268+
transport http {
269+
tls
270+
tls_insecure_skip_verify
271+
}
272+
}
273+
calibre.xxx.com {
274+
reverse_proxy https://172.xxx.xxx.xxx:8181 {
275+
import allow_insecure_ssl
276+
}
277+
}
278+
```
279+
280+
**Bonus Tip 2**: If you use [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy), you can simply apply the following labels to your docker-compose yaml file:
281+
282+
```yaml
283+
labels:
284+
caddy: calibre.xxx.com
285+
caddy.reverse_proxy: "{{upstreams https 8181}}"
286+
caddy.reverse_proxy.transport: http
287+
caddy.reverse_proxy.transport.tls:
288+
caddy.reverse_proxy.transport.tls_insecure_skip_verify:
289+
```
290+
245291
??? faq "Why does LinuxServer.io recommend to use docker-compose over Portainer?"
246292

247293
##### Why does LinuxServer.io recommend to use docker-compose over Portainer? { #portainer }

0 commit comments

Comments
 (0)