The Headers More module (ngx_headers_more) for Nginx is a third-party module that extends Nginx's capabilities to manipulate HTTP headers more flexibly than the built-in and directives.
add_header
proxy_set_header
How to enable the Headers More module in Nginx:
1. Check if your existing Nginx includes the module
First, check if your current Nginx installation already has the module included:
bash
nginx -V 2>&1 | grep headers-more
If it lists --add-module=...headers-more-nginx-module or --with-http_headers_more_module, then the module is already enabled.
If no mention, you need to compile it or install a version of Nginx that includes it.
2. If not included — compile Nginx with headers-more module
The headers-more module is not included by default in the official Nginx binaries (except some third-party distributions). You have two options:
Option A: Build Nginx from source with the module
Download and extract Nginx source:
bash
wget https://nginx.org/download/nginx-<version>.tar.gz
tar zxvf nginx-<version>.tar.gz
cd nginx-<version>