Closed kilasuelika closed 9 months ago
Unsure how to fix this. I’ll leave this open to see if someone else has any tips.
have the same problem
docker logs show this problem
I've encountered the same issue. The project is deployed on Linux and the http proxy http://127.0.0.1:7890 has already been set up. However, errors still occur. Does the project have a function for proxy settings?
Same issue here.
I have the same needs
Using the Docker environment variable OPENAI_API_HOST can help you.
Setup a proxy server by using the this code:
Then set environment variable OPENAI_API_HOST to http://<your-proxy-server-ip>
Using the Docker environment variable OPENAI_API_HOST can help you. 源码全局一搜索,里有还真有这个环境变量。 👍 👍 👍 👍
I could try to add a connection through the proxy server function using pull request. It would be more convenient than the solutions above.
Here is a simple method to configure a reverse proxy for https://api.openai.com
using Caddy. First, install Caddy on your cloud server and bind a domain name to the server, such as example.com
. Then add the following configuration to the Caddyfile:
example.com {
reverse_proxy /* https://api.openai.com {
header_up Host api.openai.com
header_up X-Forwarded-Proto {scheme}
header_up X-Forwarded-For {remote}
}
}
Restart Caddy service, you can use https://example.com
to send requests to the OpenAI API. As for Chatbot-UI, you can add OPENAI_API_HOST=https://example.com
in the .env.local
file to set up it.
Setup a proxy server by using the this code:
Then set environment variable OPENAI_API_HOST to
http://<your-proxy-server-ip>
how to use this proxy.js,which releative path can set it?
Have you solved it yet?
I deployed this project using Docker. I accessed the OpenAI API from a server in the United States while I was in mainland China. Before that, I tried to use an HTTP proxy on my Linux server in China, but it failed. So, I used Nginx to configure a reverse proxy on my server in the United States. Therefore, I did not directly use https://api.openai.com/, but instead used my own server's domain, http://mydomain.com/.
First, I built a local image using the command "docker build chatgpt-ui:4.12 .". Then, I created a container using the command "docker run -itd -e OPENAI_API_KEY=skXXXXXXXXX -e OPENAI_API_HOST=http://mydomain.com/ -p 3100:3000 --name openai-chat chatgpt-ui:4.12". However, it still did not work. When I entered a question in the chat interface, there was no response.
So, I used the command "docker exec -it openai-chat sh" to enter the container and searched for all content related to https://api.openai.com/ in the project. I replaced them all with http://mydomain.com/ and then restarted the container. It worked properly after that. I am not familiar with script languages, so I had to make these changes in a rough way. However, there are still many issues in the project, and I am looking forward to the author's improvements.
I have a networking problem and it seems that I have to set a proxy. Message: