If you want to add the Nginx proxy for OpenAI API

You can use the following nginx configs.

 location /v1/chat/completions {
        proxy_pass https://api.openai.com/v1/chat/completions;
        proxy_ssl_name api.openai.com; 
        proxy_ssl_server_name on;
        # Forward all headers
        proxy_pass_request_headers on;
        # proxy_http_version 1.1;
    }

And then restart the Nginx server

sudo nginx -t
sudo systemctl restart nginx
Nginx Proxy for OpenAI API
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.