国外服务器反代 nginx 配置
2024/12/31实践中已使用 近1年
location / {
# 转发地址
proxy_pass https://api.openai.com;
# 避免出现反代https域名出现502错误
proxy_ssl_server_name on;
proxy_set_header Host api.openai.com;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
# 关闭缓存实现打字机效果
proxy_buffering off;
proxy_cache off;
proxy_set_header X-Forwarded-For '本机IP';
proxy_set_header X-Forwarded-Proto 'https';
}
本作品采用《CC 协议》,转载必须注明作者和本文链接