In fact, When I started ollama-webui in the 3389 port, everything was ok. But when I proxy it by nginx, there is a 403 Forbidden error.
Do anyone know what the problems are?
Originally created by @lingen on GitHub (Dec 22, 2023).
I just want to proxy ollama-webui by nginx.
And there is the config
```nginx
server
{
listen 3389;
server_name ai.myai.com;
location /
{
proxy_redirect off;
proxy_pass http://127.0.0.1:8082;
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-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream off;
}
}
```
Also, I started the ollama-webui in docker.
```shell
docker run -d -p 8082:8080 --add-host=host.docker.internal:host-gateway --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main
```
In fact, When I started ollama-webui in the 3389 port, everything was ok. But when I proxy it by nginx, there is a 403 Forbidden error.
Do anyone know what the problems are?
<img width="644" alt="image" src="https://github.com/ollama-webui/ollama-webui/assets/2062865/ca43686d-86e9-4742-8b1f-baae2fa9d9ed">
@oliverbob commented on GitHub (Dec 23, 2023):
Have you tried doing it with this [Apache proxy example](https://github.com/ollama-webui/ollama-webui/issues/256)?
But I have no idea why this happened. And I thought this was not Ollama-webui's problem. Maybe it's ollama server's problem.
Because the 403 error is generated by Ollama Server but not Ollama-webui.
Thanks. I appreciate your help.
@lingen commented on GitHub (Dec 25, 2023):
@oliverbob
OK, I solve this problem.
The blew config of the Nginx proxy is ok.
```nginx
server {
listen 3389;
server_name ai.myai.com;
location / {
proxy_pass http://127.0.0.1:8082;
}
location /ollama/api {
proxy_buffering off;
proxy_set_header Origin '';
proxy_set_header Referer '';
proxy_pass http://127.0.0.1:11434/api;
}
location /api/v1 {
proxy_pass http://127.0.0.1:8082/api/v1;
}
}
```
And there two lines are very important
```shell
proxy_set_header Origin '';
proxy_set_header Referer '';
```
But I have no idea why this happened. And I thought this was not Ollama-webui's problem. Maybe it's ollama server's problem.
Because the 403 error is generated by Ollama Server but not Ollama-webui.
Thanks. I appreciate your help.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @lingen on GitHub (Dec 22, 2023).
I just want to proxy ollama-webui by nginx.
And there is the config
Also, I started the ollama-webui in docker.
In fact, When I started ollama-webui in the 3389 port, everything was ok. But when I proxy it by nginx, there is a 403 Forbidden error.
Do anyone know what the problems are?
@oliverbob commented on GitHub (Dec 23, 2023):
Have you tried doing it with this Apache proxy example?
@lingen commented on GitHub (Dec 25, 2023):
Thank you very much. I will try it.
@lingen commented on GitHub (Dec 25, 2023):
@oliverbob
OK, I solve this problem.
The blew config of the Nginx proxy is ok.
And there two lines are very important
But I have no idea why this happened. And I thought this was not Ollama-webui's problem. Maybe it's ollama server's problem.
Because the 403 error is generated by Ollama Server but not Ollama-webui.
Thanks. I appreciate your help.