Caddy HTTP server
Caddy is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.
To install caddy, first add the caddy program to your gokrazy instance:
Then, open your instance’s config.json in your editor:
And make the following changes:
- Change the HTTP port from 80 (default) to 1080 (for example) to move gokrazy’s web interface listening port out of the way and let caddy serve on TCP port 80. If you want to run caddy on a different port, you can skip this step.
- Configure Package config: Command-line
flags and Package config: Extra
files to make caddy run its webserver
on startup (
run) and to make caddy locate its config file (--config).
Then, create the referenced Caddyfile extra file and modify it to your
liking. In this example, we explicitly configure an HTTP listener to disable
Caddy’s automatic HTTPS setup, so that your server will work without a
publically reachable address.
Then, deploy as usual:
Tip: When using breakglass, use the -gokrazy_url=:1080 flag to overwrite
the port.