1
proxy_pass   http://myserver;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

Above is my nginx configuration, and myserver requires NTLM authentication. I access myserver through nginx proxy and provide correct auth info,but the browser prompt auth again.

Any wrong with my configuration?

EIDT: Referred to this ,I use stream proxy and problem solved!

Thanks to @Tarun Lalwani

BuggyShow
  • 13
  • 1
  • 5

1 Answers1

1

According to nginx documentation:

Allows proxying requests with NTLM Authentication. The upstream connection is bound to the client connection once the client sends a request with the “Authorization” header field value starting with “Negotiate” or “NTLM”. Further client requests will be proxied through the same upstream connection, keeping the authentication context.

upstream http_backend {
    server 127.0.0.1:8080;

    ntlm;
}

The "ntlm" option is available only for Nginx Plus.
I created a custom module that is able to provide a similar functionality

gabihodoroaga/nginx-ntlm-module

There is also a blog post about this at hodo.dev