grpc_hide_header

The grpc_hide_header directive prevents specific headers in gRPC responses from being sent to clients.

Syntaxgrpc_hide_header header_name;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The grpc_hide_header directive is used to control which headers are omitted from the gRPC responses served by NGINX. This directive can help manage sensitive information or control client interactions by hiding headers that may be exposed otherwise. It takes one argument, which specifies the name of the header to be hidden. When this directive is set, any response from the gRPC server that includes the specified header will be filtered out by NGINX before reaching the client.

Config Example

location /grpc {
    grpc_pass grpc://backend;
    grpc_hide_header X-My-Header;
}

Ensure that the header name is correctly spelled and matches the case of the header in the response.

Be cautious when hiding headers that may be crucial for client functionality, as this might lead to unexpected behavior.

← Back to all directives