Running Open WebUI on plain http:// works on your own PC, but it breaks as soon as you open it from another device. Browsers block the microphone, so voice calls stop working. Clipboard and location variables fail. And your chats, passwords and uploads cross the network unencrypted.
The fix is a reverse proxy with a TLS certificate. This guide shows the three common setups: Caddy, which gets certificates automatically in two lines; Nginx with Let’s Encrypt for full control; and HAProxy for load balancing.
It also covers the settings that matter most for Open WebUI, which are WebSockets, proxy buffering, timeouts, upload size and secure cookies, plus the no-port-forwarding options and fixes for common errors. It follows the official Open WebUI documentation as of December 2026.
- Easiest: Caddy with
your-domain.com { reverse_proxy localhost:3000 }gets a Let’s Encrypt cert automatically. - Nginx must have:
proxy_http_version 1.1,Upgrade/Connectionheaders,proxy_buffering off, long timeouts and a bigclient_max_body_size. - Set in Open WebUI:
WEBUI_URL, plusWEBUI_AUTH_COOKIE_SECURE=trueandWEBUI_SESSION_COOKIE_SECURE=true. - Let’s Encrypt needs a domain; it cannot issue certificates for an IP address.
- No open ports? Use Cloudflare Tunnel, Tailscale or ngrok instead.
- Voice calls need HTTPS unless you use
localhost.
Why Open WebUI Needs HTTPS
- Voice calls: browsers only allow microphone access on secure origins. Over
http://on anything other thanlocalhost, voice calls will not work. See our Open WebUI voice guide. - Prompt variables:
{{CLIPBOARD}}and{{USER_LOCATION}}need a secure context. Without it you see “Failed to read clipboard contents” or “Location access not allowed”. - Privacy: TLS encrypts chats, logins and uploaded files between the browser and your server.
- Single sign-on: most identity providers require HTTPS callback URLs; see Open WebUI SSO.
Choose Your Method
| Method | Best for | Certificates |
|---|---|---|
| Caddy | Self-hosted, minimal config | Automatic (Let’s Encrypt) |
| Nginx | Self-hosted production, full control | Let’s Encrypt via Certbot, or your own |
| HAProxy | High availability and load balancing | Let’s Encrypt or your own |
| Cloudflare Tunnel | Production without open ports | Automatic at Cloudflare’s edge |
| Tailscale | Private access from your own devices | Automatic with tailscale serve |
| ngrok | Quick tests and demos | Automatic at ngrok’s edge |
If you are new to reverse proxies, start with Caddy. If you already run Nginx for other sites, add Open WebUI to it.
Before You Start
- A domain or subdomain (for example
chat.example.com) with a DNSArecord pointing at your server’s public IP. Let’s Encrypt cannot issue certificates for a bare IP address. - Ports 80 and 443 open on your firewall and router, forwarded to the server.
- Open WebUI running. Docker publishes it on port 3000 by default (
-p 3000:8080); a pip install listens on 8080. Use whichever port yours uses in the examples below. Running without Docker? See install Open WebUI without Docker.
Once the proxy works, stop exposing the Open WebUI port to the internet. In Docker, publish it only on localhost (-p 127.0.0.1:3000:8080) so traffic must go through the proxy.
Option 1: Caddy (Automatic HTTPS)
Caddy fetches and renews Let’s Encrypt certificates on its own, so the whole config is two lines.
- Install Caddy from the official instructions for your OS (on Ubuntu or Debian, add Caddy’s apt repository and run
sudo apt install caddy). - Edit
/etc/caddy/Caddyfile:chat.example.com { reverse_proxy localhost:3000 } - Reload Caddy:
sudo systemctl reload caddy - Open
https://chat.example.com. The first request can take a few seconds while the certificate is issued.
Caddy proxies WebSockets and streams responses without extra settings. For very large uploads or long API requests, you may still need to raise limits; check the Caddy docs for request_body and transport timeouts.
Option 2: Nginx With Let’s Encrypt
Nginx gives the most control. The Open WebUI docs include a Docker Compose and Certbot setup; on a normal Linux server the steps below do the same with the system packages.
- Install Nginx and Certbot:
sudo apt install nginx certbot python3-certbot-nginx - Create
/etc/nginx/sites-available/open-webuiwith this config (replace the domain and port):upstream openwebui { server 127.0.0.1:3000; keepalive 128; } server { listen 80; server_name chat.example.com; client_max_body_size 100M; # API and model proxies: streaming, no buffering location ~ ^/(api|openai|ollama)/ { proxy_pass http://openwebui; 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-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; proxy_request_buffering off; proxy_cache off; gzip off; tcp_nodelay on; add_header X-Accel-Buffering "no" always; proxy_read_timeout 1800; proxy_send_timeout 1800; } # WebSocket for live chat location ~ ^/(ws/|socket\.io/) { proxy_pass http://openwebui; 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-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; proxy_read_timeout 86400; proxy_send_timeout 86400; } location / { proxy_pass http://openwebui; 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-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } - Enable it and test:
sudo ln -s /etc/nginx/sites-available/open-webui /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx - Get the certificate:
sudo certbot --nginx -d chat.example.comCertbot adds the
listen 443 ssllines and an HTTP to HTTPS redirect, and sets up automatic renewal. - Check renewal works:
sudo certbot renew --dry-run.
Why each setting matters
| Setting | What goes wrong without it |
|---|---|
proxy_http_version 1.1 + Upgrade/Connection |
WebSocket fails, so chat never updates live |
proxy_buffering off |
API clients get streamed replies in bursts or only at the end |
Long proxy_read_timeout |
Long answers, uploads or transcriptions cut off with 504 errors |
client_max_body_size |
413 errors on uploads, and lost edits or ratings in long chats (Nginx’s default is only 1 MB) |
gzip off on API paths |
Compression buffers the stream |
If you enable HTTP/2 on the listen 443 line, keep proxy_http_version 1.1 for the backend. The docs note WebSockets are more stable through the HTTP/1.1 upgrade than over HTTP/2. Prefer a GUI? The docs also cover Nginx Proxy Manager, where you tick “Websockets Support” on the proxy host.
Option 3: HAProxy
Use HAProxy when you need health checks or several Open WebUI instances. The key parts of /etc/haproxy/haproxy.cfg from the docs:
defaults
mode http
option forwardfor
option http-server-close
timeout connect 120s
timeout client 10m
timeout server 10m
option h2-workaround-bogus-websocket-clients
frontend web
bind 0.0.0.0:80
bind 0.0.0.0:443 ssl crt /etc/haproxy/certs/
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl
acl chat-acl hdr(host) -i chat.example.com
use_backend owui_chat if chat-acl
backend letsencrypt-backend
server letsencrypt 127.0.0.1:8688
backend owui_chat
option forwardfor
option httpchk GET /health
http-request set-header X-Forwarded-Proto https if { ssl_fc }
server chat 127.0.0.1:3000 check
Run Certbot in standalone mode on port 8688 to get certificates through the ACME backend, then combine the certificate and key into one .pem file in the crt folder, as HAProxy expects. The h2-workaround-bogus-websocket-clients option fixes freezes some clients see with WebSockets over HTTP/2.
To balance across several instances, the docs require WEBSOCKET_MANAGER=redis with REDIS_URL, a shared database such as PostgreSQL, and the same WEBUI_SECRET_KEY everywhere.
Open WebUI Settings Behind a Proxy
| Setting | Value | Why |
|---|---|---|
WEBUI_URL |
https://chat.example.com |
Correct links in notifications and webhooks. After first start, change it in Admin Settings, General |
WEBUI_AUTH_COOKIE_SECURE |
true |
Login cookie only sent over HTTPS |
WEBUI_SESSION_COOKIE_SECURE |
true |
Session cookies only sent over HTTPS |
CORS_ALLOW_ORIGIN |
Unset, or your exact origin | A wrong value (for example an http:// origin) breaks WebSocket |
FORWARDED_ALLOW_IPS |
Your proxy’s IP | Only trust X-Forwarded-* headers from the proxy |
ENABLE_WEBSOCKET_SUPPORT |
false only if your proxy cannot upgrade |
Switches to long-polling |
Also make sure the proxy passes the original Host header plus X-Forwarded-For and X-Forwarded-Proto. Open WebUI uses them for client IPs in audit logs and to build SSO callback URLs. It does not read X-Real-IP.
No Open Ports: Tunnels and Tailscale
If you cannot open ports 80 and 443, for example behind CGNAT or on a home connection, skip the proxy:
- Cloudflare Tunnel: a small
cloudflaredagent connects out to Cloudflare, which serves your domain with HTTPS. Good for production. - Tailscale:
tailscale servegives your server an HTTPS address that only your own devices on the tailnet can reach. Good for private use. - ngrok: one command gives a temporary HTTPS URL. Good for demos.
All three handle certificates for you. Keep sign-ups closed and use strong passwords, since tunnels make the instance reachable from wherever the tunnel allows.
Check Your Setup
- Open the site and confirm the padlock and a valid certificate.
- Send a chat and watch tokens stream in smoothly.
- Open the browser dev tools Network tab and check that
/ws/socket.ioshows status 101 (Switching Protocols). - Upload a large PDF to confirm there is no 413 error.
- Try a voice call on your phone; the microphone prompt should appear.
- Check the health endpoint:
curl https://chat.example.com/health.
Troubleshooting
Chat spins forever or never updates live
WebSocket is not upgrading. Add proxy_http_version 1.1 and the Upgrade/Connection headers for /ws/socket.io, and check CORS_ALLOW_ORIGIN. More fixes in Open WebUI connection errors.
413 Request Entity Too Large
Raise client_max_body_size in Nginx (or the equivalent limit in your proxy) above your largest upload and longest chat.
504 Gateway Timeout on long answers
Raise the proxy read timeout to at least 300 seconds; the docs’ Nginx example uses 1800.
API clients get the reply all at once
Turn off proxy buffering, gzip and caching on the /api, /openai and /ollama paths.
Certbot fails to get a certificate
Check that DNS points at the server, port 80 is reachable from the internet, and you used a domain rather than an IP.
Logged out on every page load
You set the secure cookie variables but are browsing over http://. Use the HTTPS address, and make sure the proxy redirects HTTP to HTTPS.
Site loads slowly after adding the proxy
Let static assets cache and add keepalive to the upstream. See why Open WebUI is slow.
FAQ
How do I enable HTTPS in Open WebUI?
Put a reverse proxy such as Caddy or Nginx in front of it with a TLS certificate, or use a tunnel like Cloudflare Tunnel or Tailscale.
Can I use Let’s Encrypt with an IP address?
No. You need a domain name. For IP-only setups, use a self-signed certificate or Tailscale.
Why do voice calls not work in Open WebUI?
Browsers block the microphone on non-HTTPS sites other than localhost. Serve Open WebUI over HTTPS.
Which port should the proxy point to?
The port Open WebUI listens on: 3000 for the default Docker setup, 8080 for a pip install.
Do I need to change Open WebUI settings?
Set WEBUI_URL to your HTTPS address and turn on the secure cookie variables. Leave CORS_ALLOW_ORIGIN unset or set it to your exact origin.
Is Caddy or Nginx better for Open WebUI?
Caddy is simpler, with automatic certificates. Nginx gives finer control over buffering, timeouts and caching.



