Proxy buffering is a feature in nginx that temporarily stores the response from a backend server before sending it to the client. This helps improve performance and manage slow clients.
Click to reveal answer
beginner
Which nginx directive controls whether proxy buffering is enabled?
The directive proxy_buffering controls if buffering is enabled. Setting it to on enables buffering, and off disables it.
Click to reveal answer
intermediate
What happens if proxy_buffering is set to off?
When proxy_buffering off; is set, nginx sends data to the client immediately as it receives it from the backend, without storing it. This can increase latency for slow clients.
Click to reveal answer
intermediate
Name two directives related to proxy buffering size in nginx.
Two important directives are proxy_buffer_size which sets the size of the buffer for the first part of the response, and proxy_buffers which sets the number and size of buffers for the rest of the response.
Click to reveal answer
intermediate
Why might you want to disable proxy buffering in nginx?
You might disable proxy buffering to reduce latency for streaming or real-time data, where you want the client to receive data as soon as possible without delay.
Click to reveal answer
What does the proxy_buffering directive do in nginx?
AControls if nginx stores backend responses before sending to clients
BEnables caching of static files
CSets the timeout for proxy connections
DDefines the maximum upload size
✗ Incorrect
proxy_buffering controls whether nginx buffers responses from the backend server before sending them to the client.
If proxy_buffering is off, what is the effect?
ANginx sends data to clients immediately as it receives it
BNginx buffers all responses fully before sending
CNginx disables proxying
DNginx caches the response on disk
✗ Incorrect
With buffering off, nginx streams data directly to the client without storing it first.
Which directive sets the size of the buffer for the first part of the response?
Aproxy_cache_path
Bproxy_buffers
Cproxy_buffer_size
Dproxy_pass
✗ Incorrect
proxy_buffer_size sets the size of the buffer used for the first part of the response.
Why is proxy buffering useful for slow clients?
AIt speeds up backend server processing
BIt reduces load on the backend by sending data at client speed
CIt stores responses to send faster to clients
DIt compresses data before sending
✗ Incorrect
Buffering allows nginx to receive the full response quickly and send it to slow clients at their pace, reducing backend load.
Which of these is NOT a reason to disable proxy buffering?
ATo reduce latency for streaming data
BTo immediately send data to clients
CTo support real-time applications
DTo improve caching efficiency
✗ Incorrect
Disabling buffering does not improve caching; it is mainly for reducing latency and streaming.
Explain what proxy buffering is in nginx and why it matters.
Think about how nginx handles backend responses before sending to clients.
You got /3 concepts.
Describe how to configure proxy buffering in nginx and what happens when it is turned off.
Consider the directives and their impact on response delivery.
You got /3 concepts.
Practice
(1/5)
1. What does proxy_buffering on; do in an Nginx configuration?
easy
A. It enables buffering of responses from the backend before sending to clients.
B. It disables buffering and sends data immediately to clients.
C. It caches static files on the client side.
D. It blocks all proxy requests.
Solution
Step 1: Understand proxy_buffering directive
The directive proxy_buffering controls if Nginx buffers backend responses before sending to clients.
Step 2: Effect of setting it to 'on'
When set to on, Nginx stores backend data temporarily to improve speed and reduce backend load.
Final Answer:
It enables buffering of responses from the backend before sending to clients. -> Option A
Quick Check:
proxy_buffering on = buffering enabled [OK]
Hint: Buffering means storing backend data before sending [OK]
Common Mistakes:
Confusing buffering with caching
Thinking it disables buffering
Assuming it blocks requests
2. Which of the following is the correct syntax to disable proxy buffering in Nginx?
easy
A. proxy_buffering disable;
B. proxy_buffering off;
C. proxy_buffering false;
D. proxy_buffering no;
Solution
Step 1: Check valid values for proxy_buffering
The valid values for proxy_buffering are on or off.
Step 2: Identify correct syntax to disable
To disable buffering, use proxy_buffering off;. Other values cause syntax errors.
Final Answer:
proxy_buffering off; -> Option B
Quick Check:
Disable buffering = proxy_buffering off [OK]
Hint: Use 'off' to disable proxy buffering in Nginx [OK]