F5N2 NGINX Configuration: Knowledge Practice Questions
Prepare for F5N2 with more than an answer.
- Exam fee
- $50 USD
- Time limit
- 30 minutes
- Questions on the exam
- 30
- Passing score
- 245
- Level
- Administrator
- Valid for
- 2 years from the date you pass the last of the four exams
Domains covered on the exam 4
- Configure NGINX as a load balancer25%
- Configure NGINX as a content cache server25%
- Configure NGINX as a web server25%
- Configure NGINX as a reverse proxy25%
- 1
A financial services company is using NGINX as an API Gateway. They need to route incoming traffic to different upstream pools based on the first path segment of the URL (e.g.,
/accounts/goes to the Accounts pool,/transactions/goes to the Transactions pool).They also need to ensure that if a request is sent to
/transactions/, the backend server receives the request with the/transactions/prefix removed (e.g.,/transactions/historybecomes/historyon the backend).Which configuration block achieves both the routing and the correct URI rewriting?
Show answer details
Correct answer: B
In NGINX, when the 'proxy_pass' directive includes a URI (even just a trailing slash '/'), NGINX replaces the part of the request URI that matches the 'location' block with the URI specified in 'proxy_pass'. Thus, 'proxy_pass http://transactions_pool/;' will strip '/transactions/' and replace it with '/', turning '/transactions/history' into '/history'. Option A lacks the trailing slash, so the original URI would be passed unmodified.
- 2
A developer wants to test a new version of an application with production traffic without impacting actual users. How can NGINX be configured to duplicate incoming requests and send a copy to a testing backend, while ignoring the responses from the testing backend?
Show answer details
Correct answer: B
The 'mirror' directive in NGINX is used to duplicate traffic. It specifies a background location where requests are mirrored. NGINX will send the request to both the primary backend and the mirrored location simultaneously, and any responses from the mirrored backend are discarded.
- 3
You are configuring NGINX as a content cache server. You attempt to define the cache storage using the
proxy_cache_pathdirective, but NGINX fails to start, citing a syntax error. In which NGINX configuration context MUST theproxy_cache_pathdirective be placed?Show answer details
Correct answer: D
The 'proxy_cache_path' directive, which sets the path and other parameters of a cache, is valid ONLY in the 'http' context. Placing it inside a 'server' or 'location' block will cause NGINX to throw a configuration syntax error.
- 4
You want NGINX to cache HTTP 200 and 302 responses for 10 minutes, and HTTP 404 responses for 1 minute. Which configuration snippet correctly defines this minimum retention policy?
Show answer details
Correct answer: C
The 'proxy_cache_valid' directive sets caching time for different response codes. You can specify multiple codes in a single directive followed by the time duration. To set different times for different codes, you use multiple 'proxy_cache_valid' directives.
- 5
A systems engineer is configuring NGINX Open Source as a load balancer for a cluster of three backend application servers. No specific load balancing algorithm has been defined in the
upstreamblock. How will NGINX distribute the incoming requests by default?Show answer details
Correct answer: B
By default, if no load balancing algorithm is specified in an upstream block, NGINX Open Source uses the Round Robin algorithm. This algorithm distributes incoming requests sequentially across all available servers in the pool, assuming equal weighting.
- 6
You are configuring passive health checks for an upstream pool in NGINX Open Source. You want NGINX to consider a server 'down' if it fails to respond successfully 5 times within a 30-second window. Which server directive parameters should you use?
Show answer details
Correct answer: B
In NGINX Open Source, passive health checks are configured using the 'max_fails' and 'fail_timeout' parameters on the 'server' directive within an 'upstream' block. 'max_fails=5' sets the number of unsuccessful attempts, and 'fail_timeout=30s' sets both the window in which those failures must occur and how long the server will be considered unavailable.
