Skip to content
Foxipa
Code Completion 5 Challenges

Complete the config: Extending Nginx

Fill in load_module, configure flags, and njs integration.

Advanced ~4 min read

Challenge 1

Attach a dynamic module at startup.

nginx Your answer
 modules/ngx_http_brotli_filter_module.so;

Press Ctrl⌘Enter to check your answer

Challenge 2

Compile the stream module into a source build.

nginx Your answer
$ ./configure  --with-http_ssl_module --with-http_v3_module;

Press Ctrl⌘Enter to check your answer

Challenge 3

Load njs code into the config.

nginx Your answer
http {
     main from /etc/nginx/njs/routes.js;
}

Press Ctrl⌘Enter to check your answer

Challenge 4

Handle a location's responses with njs.

nginx Your answer
location /ping {
     main.ping;
}

Press Ctrl⌘Enter to check your answer

Challenge 5

Load one module from the distro modules directory in main context.

nginx Your answer
 /usr/share/nginx/modules/ngx_http_brotli_filter_module.so;

Press Ctrl⌘Enter to check your answer