我有下面的 nginx conf 文件将所有请求(默认情况下)重定向到 /auth (我的服务),然后返回响应标头(foo_id)。该标头将被转发到用户触发的原始请求 URI。下面的内容与 nginx 一起正常工作。...
location /
{
auth_request /auth;
auth_request_set $foo_id $upstream_http_foo_id;
proxy_pass $request_uri
proxy_set_header X-foo-Token $foo_id;
root html;
index index.html index.htm;
}
location /auth
{
internal;
proxy_pass https://myhost/myservice;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
Run Code Online (Sandbox Code Playgroud)
但我需要实现上述用例所需的相应入口规则/注释。我无法获得相应的身份验证/代理通行证相关注释。请帮忙。