#PROXY-START/
location ^~ /
{
proxy_pass
https://api.openai.com;
proxy_set_header Host
api.openai.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
#Persistent connection related configuration
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_filee3LUvqQR 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_filee3LUvqQR 1;
expires 12h;
}
if ( $static_filee3LUvqQR = 0 )
{
add_header Cache-Control no-cache;
}
}
#PROXY-END/
这是宝塔给我配置的片段