Caddy
Caddy is a modern HTTP server that supports automatic HTTPS certificate application and renewal, reverse proxy, and automatic DNS resolution configuration. Caddy Installation Documentation. Select the installation steps corresponding to your operating system and proceed with the installation.Configure Caddyfile
This document assumes using the Ubuntu system to deploy LangBot. In the system, the default location of Caddyfile is/etc/caddy/Caddyfile.
Use vim or nano to edit Caddyfile, and fill in the Caddyfile as follows:
If your Caddy and LangBot are deployed using containers, please check Container Network Configuration Details
https://your.domain.com.
Set Bot Callback Address Prefix
If you need to use bots that require Webhook callback addresses such as QQ Official Bot, WeChat Official Account, WeCom, Slack, LINE, etc., please setapi.webhook_prefix in the data/config.yaml file to your domain name. For example: https://your.domain.com.
After that, you will see the correctly displayed callback address on the bot management page.
NGINX
NGINX is also a commonly used HTTP server and reverse proxy tool that can be used to implement HTTPS access to LangBot.Install NGINX
On Ubuntu, you can install NGINX with the following commands:Prepare SSL Certificate
You can use Let’s Encrypt to apply for a free SSL certificate. It is recommended to use the Certbot tool to obtain a certificate:Configure NGINX Reverse Proxy
LangBot’s pipeline debugging feature requires using WebSocket connections, so NGINX needs to be configured to support WebSocket. Edit the NGINX configuration file/etc/nginx/sites-available/langbot (you can use vim or nano editor):
your.domain.com with your actual domain name.
Enable this configuration and restart NGINX:
Set Bot Callback Address Prefix
Similarly, setapi.webhook_prefix to https://your.domain.com in the data/config.yaml configuration file, so that the bot Webhook callback address will be correct.
After completing the above configuration, you can securely access LangBot WebUI and bot Webhook services through https://your.domain.com.