NGINX Configuration: Knowledge Free Sample Questions

Description

Covers configuring and deploying NGINX in the roles of a load balancer, a content caching server, a general-purpose web server, and a reverse proxy for handling client connections.

12 free sample questions150 in the full practice test

Try simulator

F5N2 Sample Questions

  1. Question 1

    Beginner

    Configure NGINX as a load balancer · Load balancing algorithms

    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 upstream block. How will NGINX distribute the incoming requests by default?

    Answer and explanation

    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.

  2. Question 2

    Intermediate

    Configure NGINX as a load balancer · Server-down behavior

    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?

    Answer and explanation

    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.

  3. Question 3

    Intermediate

    Configure NGINX as a load balancer · LB algorithms

    A high-traffic e-commerce site uses NGINX to load balance requests to backend inventory servers. Some inventory queries take significantly longer to process than others, leading to uneven load distribution when using Round Robin. Which algorithm is best suited to resolve this issue by routing new requests to the server with the lowest active workload?

    Answer and explanation

    Correct answer: D

    The 'least_conn' algorithm instructs NGINX to pass a new request to the server with the least number of active connections, while also taking server weights into consideration. This is ideal for scenarios where requests have varying execution times, preventing one server from being overwhelmed while others sit idle. Note that 'least_time' is an NGINX Plus exclusive feature.

  4. Question 4

    IntermediateMultiple answers

    Configure NGINX as a load balancer · Layer 4 (stream) load balancing

    An administrator needs to configure NGINX to load balance raw TCP traffic for a legacy database cluster, rather than HTTP traffic. Which TWO directives or blocks are essential for configuring this Layer 4 load balancing? (Select TWO)

    Answer and explanation

    Correct answers: A, C

    Layer 4 (TCP/UDP) load balancing in NGINX must be configured within the 'stream' context, as opposed to the 'http' context used for Layer 7 traffic.

    Within the 'stream' block's 'server' configuration, the 'proxy_pass' directive is used to forward the raw TCP/UDP connections to an upstream group.

  5. Question 5

    Beginner

    Configure NGINX as a load balancer · Server-down behavior

    True or False: NGINX Open Source supports out-of-the-box active health checks (using the health_check directive) to proactively probe upstream servers without relying on actual client traffic.

    Answer and explanation

    Correct answer: B

    False. NGINX Open Source only supports passive health checks (monitoring real client requests for errors). Active health checks, which use the 'health_check' directive to proactively send synthetic probes to backend servers, are a commercial feature exclusive to NGINX Plus.

  6. Question 6

    Advanced

    Configure NGINX as a load balancer · LB algorithms

    A video streaming platform uses NGINX to load balance requests to backend cache servers. To maximize cache hit ratios, requests for the same video file must always be routed to the same backend server, regardless of the client's IP address. Which load balancing configuration achieves this?

    Answer and explanation

    Correct answer: C

    The 'hash' algorithm allows you to distribute load based on a specific text string or variable. By using 'hash $request_uri', NGINX maps requests for the same file path to the same backend server, improving cache utilization. Adding the 'consistent' parameter ensures minimal remapping if a server is added or removed (Consistent Hashing).

Register free for 6 more questions

Or unlock all 150 F5N2 questions with explanations, timed mode and flashcards.