0
0
Nginxdevops~10 mins

Connection limiting (limit_conn) in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a connection limit zone named 'addr' with 10MB of shared memory.

Nginx
limit_conn_zone $binary_remote_addr zone=addr:[1];
Drag options to blanks, or click blank then click option'
A10m
B5m
C20m
D50m
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'm' is required, uppercase 'M' causes errors.
Choosing too small or too large memory size can cause configuration issues.
2fill in blank
medium

Complete the code to limit connections per IP address to 5.

Nginx
limit_conn addr [1];
Drag options to blanks, or click blank then click option'
A20
B10
C5
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the limit too high defeats the purpose of limiting.
Setting the limit too low may block legitimate users.
3fill in blank
hard

Fix the error in the code to correctly limit connections using the zone 'addr'.

Nginx
limit_conn_zone $binary_remote_addr zone=addr:[1];
limit_conn addr 10;
Drag options to blanks, or click blank then click option'
A10
B10mb
C10M
D10m
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase 'M' or 'mb' causes syntax errors.
Using a number instead of zone name in limit_conn causes errors.
4fill in blank
hard

Fill both blanks to limit connections per IP to 3 with a 5MB zone named 'client'.

Nginx
limit_conn_zone $binary_remote_addr zone=[1]:[2];
limit_conn client 3;
Drag options to blanks, or click blank then click option'
Aclient
B5m
Caddr
D10m
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching zone names between directives.
Using incorrect zone size units.
5fill in blank
hard

Fill all three blanks to create a connection limit zone 'userip' with 15MB memory and limit connections to 7.

Nginx
limit_conn_zone $binary_remote_addr zone=[1]:[2];
limit_conn [3] 7;
Drag options to blanks, or click blank then click option'
Auserip
B15m
D10m
Attempts:
3 left
💡 Hint
Common Mistakes
Using different zone names in limit_conn_zone and limit_conn.
Incorrect zone size units or values.