-
Notifications
You must be signed in to change notification settings - Fork 0
Caddy Example
This guide keeps BlueMap and BlueMapWebChat running as local HTTP services, then exposes them through Caddy over HTTPS.
User browser
↓ HTTPS
Caddy :443
├─ / -> BlueMap web server, usually 127.0.0.1:8100
└─ /bmwc/* -> BlueMapWebChat API and standalone page, usually 127.0.0.1:8899
/bmwc/api -> internal /api
/bmwc/chat -> internal /chat
The browser should use one public origin:
https://map.example.com/
https://map.example.com/bmwc/api/config
https://map.example.com/bmwc/chat
The internal services can stay on their original HTTP ports.
Caddy usually obtains and renews Let's Encrypt certificates automatically when the domain points to the server and ports 80/tcp and 443/tcp are reachable.
sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' \
| sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' \
| sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install -y caddysudo dnf install -y 'dnf-command(copr)'
sudo dnf copr enable @caddy/caddy
sudo dnf install -y caddysudo pacman -S caddyCopy examples/caddy/Caddyfile and change the domain.
map.example.com {
encode zstd gzip
handle_path /bmwc/* {
reverse_proxy 127.0.0.1:8899
}
handle {
reverse_proxy 127.0.0.1:8100
}
}handle_path /bmwc/* strips /bmwc, so /bmwc/api/config is forwarded to the plugin as /api/config, and /bmwc/chat is forwarded as /chat.
Apply it:
sudo cp examples/caddy/Caddyfile /etc/caddy/Caddyfile
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl reload caddyUse this minimal HTTPS reverse-proxy override:
http:
host: "127.0.0.1"
port: 8899
path-prefix: "/api"
cors-origin: "https://map.example.com"
web-addon:
api-base-url: "/bmwc/api"
standalone-web:
enabled: true
path: "/chat"
# Optional. Same value as web-addon.api-base-url is valid.
api-base-url: "/bmwc/api"
upload:
# Recommended: keep empty. If needed, "/bmwc/api" or "/bmwc/api/uploads" also works.
public-base-url: ""
emoji:
# Recommended: keep empty. If needed, "/bmwc/api" or "/bmwc/api/emojis" also works.
public-base-url: ""
ui:
image-preview-max-height: 720Replace map.example.com with your real domain.
Keep media preview max-height enabled for scroll stability. Recommended: 640-720. 0 means unlimited and can cause scroll jumps in media-heavy virtual scrolling.
BlueMap may keep using its existing web port, commonly 8100. For public deployments, expose only Caddy's 80/tcp and 443/tcp ports to the internet and keep BlueMap and BlueMapWebChat internal.
Allow from internet: 80/tcp, 443/tcp
Block from internet: 8100/tcp, 8899/tcp
Internally, Caddy connects to 127.0.0.1:8100 and 127.0.0.1:8899.
- Point your domain A/AAAA record to the server IP.
- Allow
80/tcpand443/tcpin the firewall. - Install Caddy.
- Copy and reload the Caddyfile.
- Set
web-addon.api-base-urlto/bmwc/api. - For
https://map.example.com/bmwc/chat,standalone-web.api-base-urlmay be left empty or set to the same/bmwc/apivalue asweb-addon.api-base-url. - Leave
upload.public-base-urlandemoji.public-base-urlempty unless you intentionally serve them from a separate public path. Legacy explicit values such as/bmwc/api/uploadsand/bmwc/api/emojisare also accepted. - Run
/bmchat reloador restart the server so the web addon files are regenerated. - Run
/bluemap reloadif BlueMap does not reload web assets automatically. - Open
https://map.example.com/orhttps://map.example.com/bmwc/chatin the browser.
Serving the BlueMap page over HTTP while only the chat API uses HTTPS is technically possible, but it is not a complete security boundary. If the page or chat.js is delivered over HTTP, a network attacker could modify the script before it talks to the HTTPS API.
For public servers, serve both BlueMap and BlueMapWebChat under the same HTTPS origin.
If you use nginx instead of Caddy, see docs/NGINX_HTTPS_EN.md and examples/nginx/bluemapwebchat.conf.
web-addon.api-base-url is the primary HTTPS public API path. Leave standalone-web.api-base-url, upload.public-base-url, and emoji.public-base-url empty unless you need a compatibility override. Empty standalone follows web-addon.api-base-url; empty upload/emoji append /uploads and /emojis. Absolute browser paths such as /bmwc/api are used as-is. Relative values without a leading / are resolved against http.cors-origin when it is a real origin. Full https://... URLs are used as-is.
Getting started
Configuration and hosting
Using BlueMapWebChat
Administration and integrations
- Administration and Security
- Uploads, Emoji, and Previews
- Notifications and Web Push
- DiscordSRV
- ImageEmojis-Bero
- ImageEmojis Client Picker
- Updates and Migration
- Release Notes
- Backup and Maintenance
Help