This page briefly explains how to use Caddy to reverse proxy Postiz. A configuration file example is below;
Example Caddyfile
api.postiz.example.lan {
reverse_proxy * localhost:3000
tls internal
}
postiz.example.lan {
reverse_proxy * localhost:4200
tls internal
}
In this example, we have two subdomains: api.postiz.example.lan
and postiz.example.lan
. The first one is configured to reverse proxy requests to a service running on localhost:3000
, while the second one proxies requests to a service running on localhost:4200
. The tls internal
directive is used to enable internal TLS for secure communication.
You will need to install the certificate into your browser with this configuration. If you are hosting on a public domain, Caddy allows you to use LetsEncrypt for automatic certificate management. For more information, refer to the Caddy documentation (opens in a new tab).
Postiz configuration
To ensure that Postiz works correctly behind a reverse proxy, you may need to adjust its configuration.
MAIN_URL: "https://postiz.example.lan"
FRONTEND_URL: "https://postiz.example.lan"
NEXT_PUBLIC_BACKEND_URL: "https://api.postiz.example.lan"