PawanOsman / ChatGPT

OpenAI API Free Reverse Proxy
https://discord.pawan.krd
GNU Affero General Public License v3.0
5.62k stars 990 forks source link

Error getting a new session #120

Closed leejay001 closed 7 months ago

leejay001 commented 7 months ago

I have deployed an instance on a VPS located in the USA using Docker. The command used for deployment was:

docker run -dp 127.0.0.1:3040:3040 pawanosman/chatgpt:latest Nginx Configuration: My Nginx is configured as follows to proxy requests to the Docker container:

nginx location /xxx/xxx/ { proxy_pass http://localhost:3040/; 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_set_header X-Forwarded-Proto $scheme; } Issue Description: When attempting to access the service through the domain https://domain.com/xxx/xxx/v1/chat/completions, I receive the following error message:

{ "status": false, "error": { "message": "Error getting a new session, If this error persists, your country may not be supported yet. If your country was the issue, please consider using a U.S. VPN or a U.S. residential proxy.", "type": "invalid_request_error" }, "support": "https://discord.pawan.krd" }

Attempted Solutions:

Ensuring that the Docker container is properly running and accessible locally. Confirming that the Nginx proxy settings are correctly configured to forward headers. Questions:

Could there be an issue with how Nginx is handling the IP forwarding that affects session creation? Are there any additional configurations or steps that I might be missing?

ffreemt commented 7 months ago

Same error messages ({"status":false,"error":{"message":"Error getting a new session, If this error persists, your country may,...) here. I use node v20.12.2 directly to deploy the whole thing. My VPS is in US. I can use my VPS as a proxy to access chat.openai.com without any problem.

It will be greadly appreciated if a fix can be suggested.

PawanOsman commented 7 months ago

VPS can't be used, Cloudflare will block you, you have to host it locally or use a resedental IP/Proxy