Headers More module is not working in nginx-devel

Hi All,

I’m using FreeBSD with nginx-devel. It seems that this problem is
lasting
for a long time (at least start from nginx 1.9.10 ).

Even though I built the source with this module, this module is still
not
working.

After add below configuration into http {},
more_set_headers “Server: my_server”;

If try to start nginx, will always get error :

nginx: [emerg] unknown directive “more_set_headers” in
/usr/local/etc/nginx/nginx.conf

Not sure which forum should I report this bug to, nginx forum or
FreeBSD
forum?

Posted at Nginx Forum:

Hello,

Jim O.

After add below configuration into http {},
more_set_headers “Server: my_server”;

If try to start nginx, will always get error :

nginx: [emerg] unknown directive “more_set_headers” in
/usr/local/etc/nginx/nginx.conf

I’m guessing that you need to add:

load_module modules/ngx_http_headers_more_filter_module.so;

to the main section of nginx. conf.

On Tue, Apr 5, 2016, at 05:43 PM, meteor8488 wrote:

If try to start nginx, will always get error :

nginx: [emerg] unknown directive “more_set_headers” in
/usr/local/etc/nginx/nginx.conf

Not sure which forum should I report this bug to, nginx forum or FreeBSD
forum?

It’s never not worked for me as long as I’ve been using it. Currently
I’ve nginx v1.9.14, and it’s fine.

Post the output of your nginx -V.

Show how you configure & build the module, or where you’re getting it
from.

Jim

Hello,

On 4/6/16 8:53 AM, meteor8488 wrote:

geoip and lua module, even though I didn’t load them, they are still
working.

So is there any differences between these modules? Why some of them need to
be loaded before use, some are not?

Most likely you are not using those modules in your configuration. You
will only get a complaint from nginx if they are referenced in your
configuration file(s) and not loaded.

Since you built nginx from FreeBSD ports, you can look at
/usr/local/etc/nginx/nginx.conf-dist and it will show all the modules
that have been built and need to be loaded dynamically if used.


Jim O.

“Never argue with a fool, onlookers may not be able to tell the
difference.” - Mark Twain

Thanks. You’re right. After I load the module, it works.

Another question is for now I have 3 modules

-r-xr-xr-x 1 root wheel 17K 4 6 07:27 ngx_http_geoip_module.so*
-r-xr-xr-x 1 root wheel 25K 4 6 07:27
ngx_http_headers_more_filter_module.so*
-r-xr-xr-x 1 root wheel 328K 4 6 07:27 ngx_http_lua_module.so*

But it seems I only need to load ngx_http_headers_more_filter_module.so.
For
geoip and lua module, even though I didn’t load them, they are still
working.

So is there any differences between these modules? Why some of them need
to
be loaded before use, some are not?

Posted at Nginx Forum: