gpt-3.5-turbo-0301· openai
Suzhen/CodeChat
使用nginx转发时,header中的Authorization没有被转发
- User
使用nginx转发时,header中的Authorization没有被转发
- Assistant
这可能是因为nginx默认情况下不会转发一些敏感的HTTP头部,其中包括Authorization头。您需要使用nginx的proxy_set_header指令将Authorization头手动添加到转发请求中。您可以在nginx.conf配置文件中的location块中使用以下语句实现:
location / { proxy_pass http://your_upstream; proxy_set_header Authorization $http_authorization; }这将从客户端发送的原始请求中提取Authorization头,并将其添加到nginx代理请求的头部中,以便将其转发到上游服务器。请注意,将敏感头部转发可能会带来安全风险,请确保您对代理目标的可信程度有充分的信心,并应用适当的安全措施。
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.