Setting up a Reverse Proxy
When exposing Liwan to the public internet, it is recommended to use a reverse proxy to handle SSL termination and other security-related tasks. This guide will show you how to set up a reverse proxy using Caddy.
There are many other reverse proxies available, such as Nginx (guide), Traefik (guide), and HAProxy (guide), which all vary in complexity and features.
Setting up Caddy
Section titled “Setting up Caddy”-
Install Caddy
First, install Caddy on your server. You can download the latest version from the official website. Depending on how you install Caddy, you may need to set up a service to run it in the background. -
Configure Caddy
A basic Caddy configuration file might look like this:/etc/caddy/Caddyfile liwan.example.com {reverse_proxy localhost:9042tls you@example.com}This configuration tells Caddy to listen for requests on
liwan.example.com
, reverse proxy them to Liwan running on port9042
, and use Let’s Encrypt to automatically obtain and renew SSL certificates. -
Start Caddy
Again, depending on your setup, you may need to start Caddy manually or set it up as a service. See the Keep Caddy Running section of the Caddy documentation for more information.Once Caddy is running, you should be able to access Liwan by visiting
https://liwan.example.com
.