O'Reilly logo

Mastering NGINX by Dimitri Aivaliotis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Decision-making in NGINX

You may find yourself trying to bend NGINX's configuration directives in ways that they were not meant to be used. This is frequently seen in configurations where there are a lot of if checks to try to emulate some sort of logic chain. A better option would be to use NGINX's embedded perl module. With this module, you will be able to use the flexibility of Perl to achieve your configuration goals.

The perl module is not built by default, so it needs to be enabled with the --with-http_perl_module configure switch. Ensure as well that your Perl was built with -Dusemultiplicity=yes (or -Dusethreads=yes) and -Dusemymalloc=no. NGINX configuration reloads will cause the perl module to leak memory over time, so this last parameter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required