Replies: 18 comments 9 replies
-
Here is my existing Nginx Configuration:
|
Beta Was this translation helpful? Give feedback.
-
Works on its Subdomain using the below config:
|
Beta Was this translation helpful? Give feedback.
-
Given the need to make the entire backend application accessible under Here's a streamlined approach to meet these requirements: Simplified NGINX ConfigurationThis configuration ensures all requests that start with location /chatgpt/ {
# Rewrite the incoming request by removing the /chatgpt prefix
rewrite ^/chatgpt/(.*)$ /$1 break;
# Proxy the modified request to the backend application
proxy_pass http://192.168.173.252:8080/;
# Optional: Set headers that might be required by the backend or for compliance with CORS, etc.
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# Handle WebSocket upgrades if your application uses WebSockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
} Key Points
This configuration approach should meet the requirement of making the backend application accessible under |
Beta Was this translation helpful? Give feedback.
-
Thank you. So I tried your config for subpath serving. Still stuck on similar errors: |
Beta Was this translation helpful? Give feedback.
-
@baba-dev ruled out cache issue? |
Beta Was this translation helpful? Give feedback.
-
Yes, Tried in incognito as well. |
Beta Was this translation helpful? Give feedback.
-
I Have noticed yet another issue, with its Subdomain specific configuration for Nginx, The downloaded models do not show up on the proxied frontend : The Domain Specific Configuration in reference to:
I do have models working and running when I access the default address: |
Beta Was this translation helpful? Give feedback.
-
A Hint to as why it may not be working when proxied, There are some JS errors in the browser window: The Server Connection Fails line seems to be the main cause. On a normal acess to IP, There are no errors in console window. |
Beta Was this translation helpful? Give feedback.
-
Hello, I've tested in my environment, configuration as below:
Screenshot below shows it works at first, but when it comes to "version.json" request, it fails. Look into the headers, it seems the request URL is wrong. I suspect the loaded JS code doesn't respect the custom path "/chatgpt", instead, it just appends its path (_app) after the hostname (or IP). To be short:
Then, I turned to below configuration using the root virtual directory ("/") for proxing. This works without problem.
My guess is something needs to be changed in the JS code to make it work with customized virtual directory of reversed proxy. |
Beta Was this translation helpful? Give feedback.
-
I"m trying to expose Open WebUI via nginx. It works fine for the UI and stuff, but the proxied ollama API has issues with event streaming. I've narrowed it down to nginx itself being the problem, and turned off proxy_buffering, but it still does not seem to chunk correctly. Any ideas?
|
Beta Was this translation helpful? Give feedback.
-
Hi, setup a reverse proxy (with Nginx Proxy Manager) for https WebUI access.. Work but not very well I can't figure out wich options or modification can made to work with the reverse proxy. |
Beta Was this translation helpful? Give feedback.
-
can't use root to proxy to the WebUI container as I have other applications running. anyone have a working NGINX reverse proxy from a sub-directory in this case? thanks! |
Beta Was this translation helpful? Give feedback.
-
This doesn't seem to be the problem from the OP, but if anyone is still having trouble with a reverse proxy and getting the streaming to work correctly, this is the right config:
|
Beta Was this translation helpful? Give feedback.
-
thanks for sharing @EmilSchurr. I have Ollama installed on a ubuntu 22 VM directly and it can be accessed from "http://127.0.0.1:11434". I installed the open webui with the following docker command: server {
listen 443 ssl;
server_name subdomain.exmple.com;
root /var/www/web-app/public;
index index.html index.htm index.php
location /chat {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_buffering off;
proxy_set_header Origin '';
proxy_set_header Referer '';
}
location /api {
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Origin '';
proxy_set_header Referer '';
proxy_pass http://127.0.0.1:8080/api;
}
location /api/v1 {
proxy_pass http://127.0.0.1:8080/api/v1;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ^~ /tools {
alias /var/www/tools;
}
}```.
but got lots of 404 errors.
![Snipaste_2024-05-07_14-27-56](https://github.com/open-webui/open-webui/assets/3521826/4684c0ed-c743-4fdc-821f-597e6f6cef47) |
Beta Was this translation helpful? Give feedback.
-
I'd like to share my configuration for Open-WebUI and ollama in docker stack and Apache HTTP Server (
|
Beta Was this translation helpful? Give feedback.
-
Can someone give indications to configure this for NPM (Nginx Proxy Manager) ? Thank you very much ! |
Beta Was this translation helpful? Give feedback.
-
does anything here actually address the issue that webui generates links and is unaware of the nginx config? i cant pass the splash screen because its wanting to find |
Beta Was this translation helpful? Give feedback.
-
Anybody got a working nginx config? I want to serve open-webui from /webui. I'm trying the aformentioned rewrite rules to :3003/, but I don't think it can work unless there's a way to inform webui that it's behind the reverse proxy, so that it adjusts its generated URLs. Likely that's the cause of our 404s. update 1: found it (WEBUI_URL) here. I've disabled the rewrite rule. nginx is still giving 504s and 499s update 2: got frustrated and tried using a different vhost. no avail
Update 3: I think I've got it working now. Not the SSL reverse proxy, but the hardware access for which it was a means to an end. See here. It'd be cool to be able to wrap this with SSL, though. |
Beta Was this translation helpful? Give feedback.
-
Hello, I have searched the forums, Issues, Reddit and Official Documentations for any information on how to reverse-proxy Open WebUI via Nginx.
Any assistance would be greatly appreciated. It seems there are JS errors when you force rewrite domain name via nginx.
Beta Was this translation helpful? Give feedback.
All reactions