Specialist modules
Choose a specialist module only for a real requirement
Nginx has optional HTTP modules for narrow tasks. DAV handles selected file-management methods, not a complete WebDAV implementation. MP4 and FLV provide file-based pseudo-streaming, not transcoding. image_filter transforms supported raster formats; XSLT transforms XML. Check build flags, libraries, limits, patch status and actual module loading. For complex media processing, prefer an isolated dedicated service or pre-generated assets.
Requirement CandidateRead-only prepared video Static files / MP4 if neededRaster thumbnail Pre-generated image / image_filterXML transformation XSLT with trusted stylesheetFile writes Dedicated authenticated storage serviceMake file writes opt-in, not a default
The DAV module implements PUT, DELETE, MKCOL, COPY and MOVE; clients may expect other WebDAV methods it does not supply. Never enable writes on a shared document root casually. In this read-only lab, no DAV methods are enabled. If write operations are necessary, use separate storage, enforce identity and authorization, quotas, permissions and backup, and test in a disposable fixture.
location /files/ { root html; dav_methods off; try_files $uri =404;}Understand response filters and legacy features
The addition filter inserts subrequest output around a response; sub_filter replaces matching strings and is not an HTML parser. A compressed upstream response may not be suitable for text replacement. random_index selects a file for a slash-ended request and is not deterministic; referer filtering is not authentication; userid cookies identify a browser for tracking, not a verified user; browser classification uses user-agent strings and is often better replaced by feature detection. FLV is a legacy media format. Use narrowly scoped transformations, never inject secrets or modify arbitrary application content.
location = /note.html { root html; sub_filter "LEARNING_MARKER" "ByteMind"; sub_filter_once on;}Treat signed links as limited access controls
secure_link supports checking configured link authenticity and optional expiration. It does not authenticate a user or replace authorization for private resources. Keep signing keys private, review the exact algorithm and link scope, expiry and replay behavior. Prefer application-managed authorization when per-user revocation is required. The table gives safe selection checks instead of a deployable signing scheme.
Module check: present and patched?Input check: trusted file or bounded transform?Access check: separate authentication and authorization?Output check: expected content and cache behavior?Practice and next steps
Practice: For thumbnails, file upload, signed download and HTML text substitution choose a module or alternative and explain one limitation each. Next lesson: nginx-njs-runtime-and-module-loading.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Specialist modules
Classify optional media and transformation modules
Does the DAV module provide every WebDAV method?
What is MP4 pseudo-streaming not?
What does sub_filter do?
Why not use Referer as access authentication?
What is a suitable alternative to runtime image transformation?