Issue: Proxy Host Authorization Fails
Issue:
Implementing basic authentication via an Access List assigned to a Proxy Host results in a '403: Forbidden' message rather than bringing up the basic authentication pop-up window.
Basic authentication may have worked for you when it was initially implemented. It did for me. But at some point (perhaps after an NPM version update) it breaks. Not sure when this happened because I don't often make changes to my configured hosts. The result is; any change made and saved to the proxy host, even unrelated changes, breaks basic authentication.
Version(s) Affected: 2.12.1
Based on some research, this problem seems to have appeared off and on in various previous versions as well.
Cause & Solution:
NPM is removing the authentication authorization header in the NGINX configuration when the proxy host is modified and saved. This breaks authentication.
As a workaround, you will will have to:
- Manually add
proxy_set_header Authorization "";
inside thelocation
block in the NGINX configuration file for the specific proxy host affected. - Restart the NGINX service to apply the changes.
Until the problem is officially corrected in an NPM version update, this will have to be performed EVERY time you make a change to a proxy host that has an Access List assigned to it.
Step By Step
FYI, the code MUST be at the precise location shown in the above image. If it is not, it will not work. After successfully fixing one proxy host file, I literally copied and pasted the entire # Authorization section into each host file affected; changing only the access list number as appropriate for the particular host I was working with (I have multiple access lists).