proxy_pass_error_message

The `proxy_pass_error_message` directive controls the handling of error messages when passing requests to a proxied backend in the NGINX Mail Core module.

Syntaxproxy_pass_error_message on | off;
Defaultoff
Contextmail, mail server
Argumentsflag

Description

The proxy_pass_error_message directive, when enabled, allows NGINX to return the error messages from the upstream server directly to the client rather than suppressing them. By default, NGINX may mask detailed error responses from the proxied service to provide a smoother user experience, but enabling this directive can be beneficial for debugging or transparency purposes. This directive can be placed within mail and server contexts of the configuration, affecting how errors are handled during mail operations.

When you enable this directive by setting it to on, the behavior of NGINX changes to allow the client to receive the actual error response headers and body as returned by the backend service. This is particularly useful when the proxied server has specific error handling that may provide insights into issues the user might be experiencing. Accordingly, the directive accepts a boolean flag as its argument, where on indicates that the error messages should be passed through and off means that they should not. The careful consideration of when to use this directive is important; using it in a production environment may expose sensitive information in error messages if not handled properly.

Config Example

mail {
    server {
        listen 25;
        proxy_pass_error_message on;
    }
}

Be cautious when enabling this directive in production, as it may expose sensitive backend error details to users.

Ensure that proxied services handle errors appropriately to avoid confusing clients with raw error outputs.

← Back to all directives