Why teams put Open WebUI behind Nginx with HTTPS
A team that needs browser access to Open WebUI over a trusted certificate usually needs a reverse proxy in front of the application. Open WebUI serves its own web interface, but a production URL for staff typically means a hostname, a certificate that browsers trust, and a single entry point that the company's network and security tooling can see and control. Nginx sits in that position: it accepts HTTPS from users, terminates TLS, and forwards requests to the Open WebUI container or process on a private address. Teams choose Nginx when they already operate it, when their security standards expect a conventional reverse proxy, or when they want a configuration that is easy to audit line by line.
The proxy has four main jobs, and each one can fail quietly. TLS termination handles the certificate, whether it comes from Let's Encrypt or an internal certificate authority. Header forwarding passes the original host, protocol and client address to Open WebUI so that redirects, cookies and logs match what users actually see. WebSocket upgrade handling must be configured explicitly, because Open WebUI relies on websocket connections for live features. Disabling response buffering for streamed model output is the job teams most often miss, since a proxy that buffers the response makes answers appear in large delayed chunks instead of token by token.
Before you commit to this layout, confirm three things with your own environment: which hostname and certificate model your security team requires, whether any upstream load balancer or cloud edge already terminates TLS, and how Open WebUI will be reached if you later run several replicas. Those answers decide where the certificate lives, which headers the proxy must set, and whether session stickiness or shared state must be planned. The Open WebUI features documentation and the scaling guide are the natural next reads for the application side of those decisions.
Request path from browser to Open WebUI through Nginx
The request starts in the user's browser on the internet side and reaches Nginx in the DMZ, where TLS terminates. Nginx forwards plain HTTP, along with WebSocket upgrade headers, to the Open WebUI process on the internal network. Open WebUI then calls the model provider, which may sit outside the network, and uses Redis and PostgreSQL for shared state when several replicas run. Check that the proxy passes upgrade headers and disables buffering for streamed responses, and that outbound calls leave only through the paths you have approved.
Traffic crosses three trust boundaries before reaching shared state and the model provider.
Choosing Let's Encrypt or an internal certificate
Let's Encrypt issues publicly trusted certificates, so browsers and API clients accept the Nginx endpoint without extra configuration. It only works when the certificate authority can reach the hostname to validate control of it, which means the name resolves in public DNS and, for HTTP validation, port 80 is reachable from the internet. Renewal is automated with an ACME client, so the operational question is who owns that automation and how failures are noticed.
- HTTP-01 validation: Requires inbound port 80 to the proxy and a public hostname. It is the simplest path for a single server with open ingress.
- DNS-01 validation: Works when port 80 is closed, by creating a TXT record through a DNS provider API. It needs credentials with narrow DNS scope, stored as secrets.
- Renewal ownership: Name a team that owns the ACME client, its timer and alerting on failed renewals, since expiry on a shared name affects every user.
- Rate and account limits: Confirm current issuance limits with the Let's Encrypt documentation before designing a fleet of short-lived hostnames.
- Air-gapped sites: Not usable, because issuance and validation both need outbound reach to the public service.
Before choosing this path, confirm with your security team whether a public hostname and public DNS record are acceptable for an internal AI tool.
An internal certificate authority signs certificates for names that only your network resolves. The trust decision moves from the public root store to your own root certificate, which must be installed on every client device, browser profile and service account that connects to Open WebUI. This suits private hostnames, regulated networks and sites with no route to the internet, but the organization takes on key custody and renewal work that a public authority would otherwise carry.
- Root and intermediate design: Decide whether the root stays offline with a signing intermediate online, and document who can sign.
- Issuance tooling: Options include an internal PKI product, an ACME-capable internal CA or a managed private CA. Confirm which one your platform team already operates.
- Trust distribution: Push the root through MDM or group policy so browsers, operating systems and scripts trust it without manual steps.
- Renewal ownership: Assign a named owner for the proxy certificate and the alerting that fires before expiry, since internal certificates are easy to forget.
- Air-gapped sites: Usually the only workable option, provided the CA, its revocation information and the root distribution method are themselves available inside the enclave.
Ask whether your PKI team can issue certificates for the exact hostname and whether revocation checking works from every client segment.
Validation and renewal are where the two models differ most in daily work. A public certificate proves control of a name through the internet, so automation depends on external reachability and DNS credentials. An internal certificate proves the request to your own authority, so automation depends on internal endpoints and the CA's issuance interface. Both can be automated, and both fail quietly when nobody watches expiry dates.
- Failure surface: Public issuance fails when ports or DNS credentials change. Internal issuance fails when the CA service, its access policy or its trust chain changes.
- Monitoring: Track expiry of the served certificate from outside the proxy, not only the renewal job logs.
- Key handling: Keep the private key on the proxy with file permissions restricted to the Nginx service account, and never store it in the Open WebUI image.
- Change windows: Schedule renewals and test the reload of Nginx before the certificate lapses, so a reload failure does not coincide with expiry.
- Cost drivers: Public issuance costs little in tooling but needs automation labor. Internal PKI costs more in people and infrastructure, and the cost recurs for as long as the CA operates.
Ask your team to demonstrate one forced renewal in a test environment before go-live.
Trust is the point where many deployments break. A public certificate is trusted by default on most managed and unmanaged devices, so users rarely see warnings. An internal certificate is trusted only where your root has been installed, so laptops, phones, containers and service accounts that never received the root will show errors or fail TLS verification. Plan trust distribution as part of the rollout, not as a fix after the first complaint.
- Managed devices: Distribute the root certificate through MDM or group policy and verify it appears in the device trust store.
- Unmanaged or contractor devices: Decide whether they may reach the service at all, because installing a root on personal hardware is a policy decision.
- Command-line and API clients: Some tools use their own bundle instead of the operating system store, so test curl, Python and any SDKs against the proxy.
- Containers and agents: Mount the root into any container that calls the endpoint over HTTPS.
- Certificate chain: Serve the intermediate certificate with the leaf so clients can build the full chain.
Ask which client types must connect, then test each one against a staging hostname before rollout.
Air-gapped and tightly restricted networks change the answer. Public Let's Encrypt validation needs outbound reach to the public issuance service and inbound reach for validation, which an enclave usually lacks. In that setting the internal CA is normally the path, and its own dependencies must be inside the enclave too. The decision then depends on whether the site can carry its root trust, revocation data and renewal tooling without any external call.
- Offline issuance: Confirm the CA can sign and revoke without contacting external services.
- Revocation access: Publish revocation information on a reachable internal location, and test that clients can read it.
- Update path: Plan how root and intermediate material, along with CA software updates, arrive through approved transfer media.
- Audit evidence: Record issuance, renewal and key ceremonies so assessors can trace certificate lifecycle events.
- Hybrid sites: Where some hostnames are public and others are private, keep the two trust models separate and document which name uses which.
Confirm with your security and compliance leads which certificate authority the site is allowed to operate, since that determines whether a public option is available at all.
Nginx settings and when each fits
This table compares the Nginx settings that matter for Open WebUI, from certificate source to streaming and upload limits, and says when each one applies. Read each row as a decision: keep the default where your setup does not need the change, and confirm the Open WebUI version in use before copying any directive. The main takeaway is that streaming, WebSockets and the external URL cause most of the failures people see behind a proxy.
| Setting | What it controls | When it fits and what to confirm |
|---|---|---|
| TLS certificate source | Who issues and renews the certificate Nginx presents | Let's Encrypt suits a public hostname you control. An internal CA suits private networks, but client devices must trust that CA. Confirm renewal automation and where the private key is stored. |
| proxy_http_version and Upgrade/Connection headers | Lets Nginx pass WebSocket upgrade requests to Open WebUI | Needed when real-time features use WebSockets. Set HTTP/1.1 and forward the Upgrade and Connection headers. Confirm the behavior in your Open WebUI version with a live chat test. |
| X-Forwarded-For and X-Forwarded-Proto | Pass the client IP and original scheme to Open WebUI | Needed for accurate audit logs, rate limiting and secure cookies behind TLS termination. Only trust these headers from your own proxy, and confirm how Open WebUI reads them in your release. |
| proxy_buffering off | Sends streamed model output to the browser as it arrives | Needed for token-by-token responses. With buffering on, answers may appear in large blocks or stall. Turning it off is usually limited to the Open WebUI location, so confirm your other routes still behave. |
| client_max_body_size | Maximum upload size Nginx accepts before forwarding | Set it to at least the largest file your knowledge base or chat uploads allow. Too small a value returns errors that look like Open WebUI failures. Confirm the upload limit configured in Open WebUI itself. |
| proxy_read_timeout | How long Nginx waits for the backend between responses | Raise it for long generations, slow local models and tool calls. Too short a value cuts off answers mid-stream. Confirm the longest response you need to support by testing with your own models. |
| CORS and origin settings | Which browser origins may call Open WebUI and how the external URL is built | Set the external URL to the public hostname users type. A mismatch breaks sign-in redirects, OIDC callbacks and some API calls. Confirm the configured public URL and any allowed origins in your deployment settings. |
Setup sequence with checks for the Nginx and HTTPS layer
This sequence takes Open WebUI from a plain HTTP listener to a named HTTPS endpoint behind Nginx, with a check at each step that confirms streaming, WebSocket traffic and certificate trust work before users depend on them.
Confirm the public URL and hostname
The platform team decides the public hostname, such as chat.example.internal, and confirms that DNS resolves it to the Nginx host from the networks where users sit. Open WebUI's own address stays private on the internal network and is reachable only from Nginx. Record the exact scheme and hostname now, because the external URL set later and the certificate must match it. Done when a lookup from a user network returns the Nginx address and the Open WebUI container or process answers on its private port only from the proxy host.
Issue the certificate for the hostname
Choose a certificate source that your security team accepts. A public Let's Encrypt certificate needs the hostname to be reachable for the chosen validation method. An internal certificate authority needs the hostname placed on the certificate and its root distributed to client devices. Ask the certificate owner to confirm the full chain, including intermediates, is delivered to the proxy. Done when the certificate's subject or subject alternative name matches the hostname and the file chain and private key are stored with restricted permissions on the Nginx host.
Write the server block with upstream, WebSocket and streaming settings
Define an upstream pointing at the private Open WebUI address, then a TLS server block that forwards the hostname and client address. Add the WebSocket upgrade headers so connections can switch protocols. Set proxy buffering off for the chat routes so streamed model output reaches the browser as it is generated, and raise read timeouts so long generations do not close early. Keep the redirect from port 80 to HTTPS in the same file. Done when
nginx -treports a valid configuration without warnings about the upstream or certificate paths.Set the external URL and forwarded header handling in Open WebUI
Set Open WebUI's external URL to the public HTTPS address so generated links, OIDC callbacks and redirects use the correct scheme and host. Configure the forwarded header trust that your Open WebUI version documents, and confirm that only the Nginx host can reach the private port. Check the current settings names in the version you run before editing them. Done when signing in through the public hostname redirects back to the same hostname over HTTPS and the server logs show the client address from the forwarded header rather than the proxy address.
Reload Nginx and confirm the certificate chain
Reload Nginx without a full restart so existing connections drain cleanly. From a machine that does not hold your internal root, run a TLS handshake check against the hostname and confirm the presented chain is trusted and complete. Test the HTTP-to-HTTPS redirect. Done when the handshake reports a trusted chain for the hostname, the redirect returns a permanent redirect to the HTTPS address, and the browser shows a padlock without warnings on a managed client.
Verify a streamed response arrives token by token
Send a chat prompt through the public hostname to a model that generates a multi-sentence reply, and watch the response appear progressively in the browser. If the whole answer appears at once after a pause, the proxy is buffering, so return to the server block and confirm buffering is off for the chat routes. Repeat with a longer generation to confirm the response is not cut off by a timeout. Done when the first tokens appear within the model's own latency and the full reply completes without a gateway error.
Verify the WebSocket connection stays open
Open the browser developer tools network panel, filter for WebSocket traffic and load a chat page. Confirm that a connection is established with a 101 Switching Protocols response and remains open while the page is idle and during a long response. Then trigger an action that depends on live updates, such as a status indicator during generation. Done when the WebSocket connection stays in an open state through these actions and the proxy logs show no repeated upgrade failures.
Test the sign-in path and record the baseline
Sign in through the public hostname with a standard user account and an administrator account. Confirm the session persists across a page reload and that signing out ends access. Save the configuration files, certificate expiry date and the test results in your change record so the next certificate renewal or Open WebUI upgrade can be checked against this baseline. Done when both account types complete sign-in and sign-out and the change record names the owner of the certificate renewal.
Where streaming and WebSockets break behind a proxy
Most failures after putting Open WebUI behind Nginx come from a few proxy settings: response buffering, the WebSocket upgrade, timeouts and body size limits. Each card names the symptom a user or administrator sees and the setting to check first.
Responses arrive all at once
Chat replies appear as one block after the model finishes instead of token by token. This usually means Nginx is buffering the upstream response. Check proxy_buffering off in the location block that forwards to Open WebUI, and confirm that no caching or compression layer in front of Nginx holds the stream. Test with a long answer after each change, since the symptom is easy to miss on short prompts.
WebSocket connections fail to upgrade
Real-time features fail, the browser console shows failed socket handshakes, and status updates stop arriving. Nginx must pass the Upgrade and Connection headers through to Open WebUI and use HTTP/1.1 toward the upstream. Check proxy_http_version 1.1 and the proxy_set_header Upgrade $http_upgrade pair, and confirm the same server block serves the socket path rather than a separate location with its own defaults.
Long generations cut off mid-answer
Long answers or slow reasoning models stop partway through, often at a consistent time. The default proxy_read_timeout in Nginx is 60 seconds, so a generation that pauses longer than that gets closed. Raise proxy_read_timeout and proxy_send_timeout for the Open WebUI location and confirm any load balancer or cloud listener in front of Nginx uses an idle timeout at least as long.
Uploads rejected with 413 errors
Document uploads for knowledge bases or chat attachments fail with a 413 Request Entity Too Large response before reaching the application. Nginx limits request bodies with client_max_body_size, which defaults to 1 MB. Set it to a value that matches the largest file your policy allows, and check that any upstream gateway or ingress applies a limit at least as large.
Redirect loops and mixed content
Login redirects loop, or the page loads over HTTP and the browser blocks scripts and sockets as mixed content. The application builds URLs from the protocol it sees, so Nginx must send X-Forwarded-Proto set to the scheme the client used, and X-Forwarded-For for client addresses. Confirm the header values after a login and check the public base URL setting that Open WebUI uses to build links.
Questions teams ask before running Open WebUI behind Nginx
How much effort does Open WebUI behind Nginx with HTTPS take, and what drives it up?
The reverse proxy itself is a small part of the work. Effort rises with the number of hostnames, whether certificates come from Let's Encrypt or an internal CA, how many upstream Open WebUI instances sit behind Nginx, and how much of the existing proxy standard your team must follow. Expect more time when the proxy is shared with other applications, when security review requires specific TLS settings, or when streaming and WebSocket behavior must be tested with long model responses. Ask any provider to break the quote into configuration, certificate automation, testing with real conversations and handover documentation.
Can our own team set up Nginx in front of Open WebUI without outside help?
Yes, if your team already runs Nginx in production and can read the Open WebUI documentation for its install method. The configuration needs WebSocket upgrade headers, a proxy timeout that suits long answers, and buffering turned off for streamed responses, all of which are standard Nginx settings. Teams with no Nginx experience, or those that must meet a written TLS or logging policy, usually benefit from an outside review of the configuration before go-live. Whether to build in-house or hire a partner depends on who will maintain the proxy after handover.
What does this setup need from our network and DNS team?
Your network and DNS team needs to create a DNS record for the hostname that users will type, point it at the Nginx host or load balancer, and open the inbound port for HTTPS on that host. For Let's Encrypt, the public challenge path must reach the server over the internet. For an internal CA, the team must confirm the DNS name resolves inside your network and that clients trust the CA certificate. Firewall rules must also allow Nginx to reach each Open WebUI instance on its internal port. Confirm these details with your network team before the build starts, since they often decide the schedule.
Should we use Let's Encrypt or an internal CA for Open WebUI?
Let's Encrypt fits a publicly resolvable hostname on a server that can answer the domain validation challenge, and it renews automatically when the renewal job runs. An internal CA fits systems that users reach only inside your network, or organizations whose policy requires certificates from their own PKI. Let's Encrypt is not a good match for hostnames that never leave the private network unless you use a DNS challenge you control. Either way, check your security policy for required key types, certificate lifetimes and where the private key is stored, and make sure every client device trusts the issuing chain.
What changes when we run several Open WebUI replicas behind Nginx?
Nginx must balance traffic across instances, but the larger change is in Open WebUI's shared state. The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, Redis as a shared store for sessions, websocket connections and application state, and shared file storage so uploads and knowledge stay reachable from every replica. It also warns that the default ChromaDB will crash in multi-process setups, so an external vector database is required. Without Redis, signing out does not revoke tokens, which remain valid until they expire, by default after 4 weeks. Nginx session settings for WebSockets must be checked against these replicas during testing.
How are certificate renewals and Open WebUI upgrades kept running?
Renewals need an automated job that requests the new certificate, reloads Nginx and records the expiry date, plus an alert that fires before expiry if the job fails. Upgrades need a process that tests the new Open WebUI release against your proxy configuration, since streaming and WebSocket behavior can change between versions. Check the Open WebUI releases page before each upgrade, and confirm whether the release falls under the Open WebUI License, because newer releases fall under it. Ask any provider who owns these jobs after handover and how failed renewals are reported.
What does a provider cover for this topic, and what do we keep?
DeployOpen plans, implements and documents self-hosted open-source platforms inside your own infrastructure, so the Nginx configuration, certificate process and handover notes would run in your environment. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts, and ongoing upgrades and renewal support are available as a retainer. Your team keeps ownership of DNS, firewall rules, the CA trust policy and the decision about who receives alerts. Ask for the written scope to list each item and its owner.
What changes when Open WebUI runs on several replicas
Once Nginx balances traffic across more than one Open WebUI instance, the proxy is no longer the hard part. Each replica must be able to serve any user at any moment, which means the state that a single container keeps on its local disk has to move to shared services first. The Open WebUI scaling guide lists the prerequisites: PostgreSQL instead of SQLite for the application database, because SQLite does not handle concurrent writes from multiple processes well, and an external vector database, because the default ChromaDB will crash in multi-process setups. Confirm each of these with your own replica count before you add a second upstream entry to the Nginx configuration.
Redis is the component people most often skip, and skipping it has a security consequence. Redis holds sessions, websocket connection state and application state that every replica must see. Without Redis, signing out does not revoke tokens. They stay valid until they expire, and the scaling guide gives the default lifetime as 4 weeks. A user who signs out on one replica can therefore keep working through another. Shared file storage is the third requirement, so that uploads and knowledge bases stay reachable from every replica. Plan these services, and test sign-out across two replicas, before any traffic is balanced.
The Nginx upstream block should follow the replica layout you chose, not the other way round. If you run one instance on a locally attached SSD or NVMe volume, the proxy points at a single server and SQLite remains acceptable only under the conditions in the scaling guide. If you run several replicas, every entry in the upstream block must reach the same PostgreSQL, Redis, vector database and file storage, and the websocket and streaming settings in this topic apply to each one. Ask your platform team to confirm which replica layout the proxy will front, and record it next to the configuration so the next change to one side does not silently break the other.
How DeployOpen scopes and delivers the Nginx and HTTPS setup
DeployOpen plans, implements and documents Open WebUI behind Nginx with HTTPS inside your own infrastructure, whether that is a cloud account, a data center or an air-gapped network. The work covers certificates, WebSocket upgrade headers, CORS settings and streaming behavior, and it is tested against the traffic your users actually generate.
How we scope
- The written scope names the hostname, certificate source (public Let's Encrypt or an internal CA) and the network path users take to reach Nginx.
- We agree which Open WebUI replicas and upstream addresses Nginx will route to before any configuration is written.
- Engagements are fixed-scope, so deliverables and timelines are agreed in writing before work starts. Ask for the list of tests included.
How we build
- We configure Nginx with WebSocket upgrade headers, proxy timeouts and buffering settings suited to streamed model responses.
- We set the CORS and forwarded-header values that match your public URL, then verify sign-in and chat from a clean browser session.
- We test certificate renewal, redirect behavior and failure responses, and record the results against the agreed scope.
How we hand over
- You receive the Nginx configuration, certificate procedure and renewal steps as files your team can read and version.
- The documentation explains each header and timeout setting, why it is set, and which Open WebUI settings it must match.
- We walk your platform and security staff through the tests and the rollback steps before the engagement closes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, including review after each Open WebUI release.
- When Open WebUI or Nginx changes a proxy requirement, we review the configuration and the test results against the new version.
- Ask us to confirm which support tier and response terms apply to your environment before you sign the written scope.

