custom log_format not inherited by server block
May 17, 2018 05:54PM
Hello. I am compiling Nginx 1.14.0 from source with a view to compiling ipscrub as a dynamic module.

My compile completes without error, my nginx.conf validates, Nginx runs as expected, yet my server block throws an error about an unknown log format.

If my `log_format` directive appears after the `access_log` directive in nginx.conf, it will not validate, stating:

nginx: [emerg] unknown log format "ipscrubbed" in /etc/nginx/nginx.conf:15

If my `log_format` directive appears before the `access_log` directive in nginx.conf, it validates.

If my `log_format` directive appears before the `access_log` directive in nginx.conf, the default server block will not validate, stating:

nginx: [emerg] unknown log format "ipscrubbed" in /etc/nginx/sites-enabled/default:2

…implying that although my custom `log_format` is valid, the default server block is not inheriting it. Which has completely thrown me. Do I need to reposition the `access_log` directive to a later point in the server block? Or is there something else fundamental that I'm overlooking?

I would very much appreciate an additional pair of eyes on this, if your interest, time and attention permits.

Thank you in advance.




My compile script: https://gist.github.com/petecooper/95b532b343372f707876161ee338b870

My nginx.conf: https://gist.github.com/petecooper/29fcf66f1fad0279b157201c8f233c59

My server block: https://gist.github.com/petecooper/b3fa68a165afd03fdaca3ba32545f49e



Edited 1 time(s). Last edit at 05/17/2018 05:58PM by petecooper.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 293
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready