Skip to content

Commit d04e37f

Browse files
committed
README: add basic docs for using imageproxy with Caddy
1 parent 80bc483 commit d04e37f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,37 @@ Note that all configuration options can be set using [environment
408408
variables](#environment-variables), which is often the preferred approach for
409409
containers.
410410

411+
### Caddy
412+
413+
You can proxy requests to imageproxy in your Caddy config using the `reverse_proxy` directive:
414+
415+
```Caddyfile
416+
@imageproxy path /api/imageproxy/*
417+
handle @imageproxy {
418+
uri replace /api/imageproxy/ /
419+
reverse_proxy http://localhost:4593
420+
}
421+
```
422+
423+
You can also run an instance of imageproxy embedded in Caddy using the [caddy module](./caddy/).
424+
This requires a custom build of Caddy with the imageproxy module included
425+
([example](https://github.com/willnorris/willnorris.com/blob/main/cmd/caddy/caddy.go)),
426+
and configuring it with the `imageproxy` directive in your Caddyfile:
427+
428+
```Caddyfile
429+
@imageproxy path /api/imageproxy/*
430+
handle @imageproxy {
431+
uri replace /api/imageproxy/ /
432+
433+
imageproxy {
434+
cache /data/imageproxy-cache
435+
default_base_url {$IMAGEPROXY_BASEURL}
436+
allow_hosts {$IMAGEPROXY_ALLOWHOSTS}
437+
signature_key {$IMAGEPROXY_SIGNATUREKEY}
438+
}
439+
}
440+
```
441+
411442
### nginx
412443

413444
Use the `proxy_pass` directive to send requests to your imageproxy instance.

0 commit comments

Comments
 (0)