1、转发配置


server {
listen 80;
server_name 43.153.222.232;


location / {
#proxy_pass https://api.openai.com/v1/chat/completions;

proxy_pass https://api.openai.com$request_uri;

proxy_pass https://chat.openai.com$request_uri;

}

}



server {
listen 80;
server_name _;

access_log /home/wwwlogs/api.openai.com.log;
error_log /home/wwwlogs/api.openai.com.err.log;

location / {
proxy_pass https://api.openai.com/v1/chat/completions;
client_max_body_size 10M;
client_body_buffer_size 128k;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_set_body $request_body;
}

}



server {
  listen 80;
  server_name _;

  access_log /home/wwwlogs/api.openai.com.log;
  error_log /home/wwwlogs/api.openai.com.err.log;

  location / {
      proxy_pass https://chat.openai.com/chat;
      client_max_body_size 10M;
      client_body_buffer_size 128k;
      proxy_connect_timeout 600;
      proxy_send_timeout 600;
      proxy_read_timeout 600;
      proxy_buffer_size 4k;
      proxy_buffers 4 32k;
      proxy_busy_buffers_size 64k;
      proxy_temp_file_write_size 64k;
      proxy_set_body $request_body;
  }

}



  • 无标签