nginx反向代理与使用NTLM的Windows身份验证 [英] nginx reverse proxy with Windows authentication that uses NTLM
本文介绍了nginx反向代理与使用NTLM的Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都知道是否可以对使用NTLM的Windows身份验证进行反向代理?我找不到任何例子. more_set_headers字段的值应该是什么?
Anyone knows if is possible to do reverse proxy with Windows authentication that uses NTLM? I cant find any example on this. What should be the values of more_set_headers field?
location / {
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
more_set_input_headers 'Authorization: $http_authorization';
proxy_set_header Accept-Encoding "";
proxy_pass http://host/;
proxy_redirect default;
#This is what worked for me, but you need the headers-more mod
more_set_headers -s 401 'WWW-Authenticate: Basic realm="host.local"';
}
如果我直接访问主机,则身份验证成功;如果我使用反向代理访问,则每次身份验证都会失败.
If I access the host directly the authentication succeed if I access with the reverse proxy the authentication fail every time.
推荐答案
要通过Nginx启用NTLM传递-
To enable NTLM pass-through with Nginx -
upstream http_backend {
server 2.3.4.5:80;
keepalive 16;
}
server {
...
location / {
proxy_pass http://http_backend/;
proxy_http_version 1.1;
proxy_set_header Connection "";
...
}
}
-拉蒙
这篇关于nginx反向代理与使用NTLM的Windows身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文