grpc_ignore_headers

The grpc_ignore_headers directive specifies which gRPC headers to ignore when processing requests.

Syntaxgrpc_ignore_headers header-name [header-name ...];
Defaultnone
Contexthttp, server, location
Arguments1+

Description

The grpc_ignore_headers directive allows the user to specify a list of gRPC headers that should be ignored during request processing. This directive takes one or more header names as arguments, and headers matching any of the specified names will be excluded from processing by the NGINX server. This can help in scenarios where certain headers may interfere with application logic or where security policies require the exclusion of specific headers from client requests.

The directive can be used in the http, server, or location contexts, which means that its effects can be scoped to the entire server, a specific virtual host, or even a particular location block. The flexibility in using this directive allows for fine-grained control over gRPC traffic management. If no headers are specified, it defaults to ignoring none, meaning all headers will be processed by default.

When using this directive, it is important to ensure that the headers you choose to ignore will not disrupt the expected functionality of your gRPC applications. Ignoring critical headers can lead to unexpected behavior in your application as the server may not receive necessary data for processing requests correctly.

Config Example

location /grpc {
    grpc_pass grpc://backend;
    grpc_ignore_headers 
        x-grpc-status
        x-user-header;
}

Ensure that essential headers are not ignored as this may lead to application errors.

Be aware of the context in which you use grpc_ignore_headers; placing it in the wrong context may lead to unexpected behavior.

← Back to all directives