Skip to content

Setup behind Reverse Proxies

Ophir LOJKINE edited this page May 13, 2026 · 18 revisions

WBO is served at the domain root by default. If you want to expose it at a subpath, configure both WBO and your reverse proxy for the public path.

For example, if WBO should be exposed at /wbo, start WBO with the environment variable WBO_BASE_PATH=/wbo.

The WBO_BASE_PATH value is the public path seen by browsers. It keeps generated links and cookies scoped to /wbo.

The reverse proxy must strip the public prefix before forwarding requests to WBO. In other words, browsers request /wbo/..., but WBO must receive /....

The examples below assume the public path is /wbo.

Recommended setup: Docker + Nginx on Debian

On a fresh Debian server, install Docker and Nginx:

sudo apt update
sudo apt install -y docker.io nginx
sudo systemctl enable --now docker nginx

Start WBO in Docker, listening only on the local machine:

sudo mkdir -p /opt/wbo/boards
sudo chown -R 1000:1000 /opt/wbo/boards

sudo docker run -d \
	--name wbo \
	--restart unless-stopped \
	--publish 127.0.0.1:5001:80 \
	--volume /opt/wbo/boards:/opt/app/server-data \
	--env WBO_BASE_PATH=/wbo \
	--env WBO_IP_SOURCE=X-Forwarded-For \
	lovasoa/wbo:latest

nginx config file

Create /etc/nginx/sites-available/wbo:

server {
	listen 80;
	server_name example.com; # Replace example.com with your domain if this Nginx serves several sites.

	location = /wbo {
		return 301 /wbo/;
	}

	# Socket.IO uses WebSocket upgrades, so this path needs upgrade headers.
	location /wbo/socket.io/ {
		proxy_pass http://127.0.0.1:5001/socket.io/;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";

		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-Host $host;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}

	# The trailing slash in proxy_pass strips /wbo/ before forwarding to WBO.
	location /wbo/ {
		proxy_pass http://127.0.0.1:5001/;

		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-Host $host;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

Enable the site and reload Nginx:

sudo ln -sf /etc/nginx/sites-available/wbo /etc/nginx/sites-enabled/wbo
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx

Then open the public URL you configured, replacing example.com with your server name or IP address. For example, use http://example.com/wbo/boards/anonymous for a plain HTTP site, or https://example.com/wbo/boards/anonymous when your proxy serves HTTPS.

Apache

First, enable the Apache modules used by the proxy example:

sudo a2enmod headers proxy proxy_http proxy_wstunnel rewrite

Then add the following to your Apache site configuration, usually in /etc/apache2/sites-enabled/yoursite.conf. Put it inside the <VirtualHost> that serves your public WBO URL.

ProxyRequests Off

# Apache adds X-Forwarded-For and X-Forwarded-Host for proxied HTTP requests.
# Keep this explicit because WBO uses these headers behind a proxy.
ProxyAddHeaders On

# Use "https" when this Apache virtual host serves public HTTPS traffic.
# Use "http" only for a plain HTTP-only site.
RequestHeader set X-Forwarded-Proto "https"

RedirectMatch 301 ^/wbo$ /wbo/

RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule ^/wbo/(.*)$ ws://127.0.0.1:5001/$1 [P,L]

ProxyPass /wbo/ http://127.0.0.1:5001/
ProxyPassReverse /wbo/ http://127.0.0.1:5001/

The X-Forwarded-Proto line is important on HTTPS sites. Without it, WBO may generate http:// links in HTML metadata and page assets, which browsers can block as mixed content.

Clone this wiki locally