我正在尝试使用nginx ngx_http_auth_request_module模块验证客户端请求,但无法将验证参数转发给验证服务器
以下是我正在使用的nginx配置
http {
upstream myapp {
server localhost;
}
include mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
location /{
auth_request /auth;
location = /auth {
internal;
proxy_method POST;
proxy_pass "http://192.168.26.100:1985/resource";
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Host $http_host;
# proxy_set_body $auth_foo;
#auth_request_set $auth_foo $upstream_http_foo;
#proxy_set_header x-user $user;
#proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
我尝试了默认的proxy_method(GET),之后我将其更改为POST但没有任何用处,是否有任何方法可以将凭据传递给身份验证服务器以便我可以验证用户是否已经过autherised,这里{{ 3}}是身份验证服务器URL
谢谢