同样的配置 openai 和 claude 就没问题:
location /xai {
proxy_pass https://api.x.ai/;
proxy_ssl_server_name on;
proxy_set_header Host api.x.ai;
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 $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
请求:
https://chat.xxxxx.com/xai/v1/chat/completions
报错:
{
"code": "Some requested entity was not found",
"error": "No handler found on route. Please double check your URL and consult https://api.x.ai/docs for more information."
}