auth_http_header
The auth_http_header directive sets the HTTP headers used for authentication in the NGINX Mail module.
Description
The auth_http_header directive is utilized within the NGINX Mail Core to define specific HTTP headers that will be sent for authentication purposes when clients connect. This directive is particularly useful for scenarios where authentication mechanisms require special headers to be processed correctly by upstream servers. By specifying the appropriate headers, the directive ensures that authentication processes are executed seamlessly during mail transactions.
This directive takes two arguments: the first argument specifies the name of the header, while the second argument indicates the expected value for that header. When a client attempts to authenticate, NGINX will include these headers in communication to verify users against a remote authentication service. This is critical in environments where integrated systems require special input formats to manage authentication effectively.
As a part of the mail server's configuration, this directive must be used inside the context of mail server blocks, ensuring that it applies to the targeted mail services effectively. Proper configuration of this directive is essential for ensuring that any external authentication services can properly recognize and respond to the specified headers, thereby providing a successful authentication flow.
Config Example
mail {
auth_http_header "X-Auth-User" "$remote_user";
}Make sure the header names are correctly spelled to avoid authentication failures.
Ensure that the headers set do not conflict with existing headers used by the NGINX server or mail client.