0
0
Nginxdevops~10 mins

IP-based access control (allow/deny) 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 allow access from the IP 192.168.1.10.

Nginx
allow [1];
Drag options to blanks, or click blank then click option'
Alocalhost
Ball
Cdeny all
D192.168.1.10
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deny all' instead of an IP address.
Using 'all' which allows everyone.
Using 'localhost' which is not the target IP.
2fill in blank
medium

Complete the code to deny access from the IP 10.0.0.5.

Nginx
deny [1];
Drag options to blanks, or click blank then click option'
A192.168.0.1
Ball
C10.0.0.5
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' which blocks everyone.
Using a wrong IP address.
Using 'localhost' which is not the target IP.
3fill in blank
hard

Fix the error in the code to allow only the IP 172.16.0.2 and deny all others.

Nginx
allow [1];
deny all;
Drag options to blanks, or click blank then click option'
A172.16.0.2
Blocalhost
Call
D0.0.0.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'allow all;' which allows everyone.
Using an incorrect IP address.
Omitting the 'deny all;' line.
4fill in blank
hard

Fill both blanks to allow 192.168.0.0/24 subnet and deny all others.

Nginx
allow [1];
deny [2];
Drag options to blanks, or click blank then click option'
A192.168.0.0/24
Ball
C0.0.0.0/0
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deny 0.0.0.0/0;' which is invalid in this context.
Using 'allow all;' which allows everyone.
Using 'deny localhost;' which does not block all others.
5fill in blank
hard

Fill all three blanks to allow 10.1.1.0/24 subnet, deny 10.1.1.100, and deny all others.

Nginx
deny [1];
allow [2];
deny [3];
Drag options to blanks, or click blank then click option'
A10.1.1.0/24
B10.1.1.100
Call
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of allow and deny directives.
Using 'deny localhost;' which does not block all others.
Omitting the final 'deny all;' line.