Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In nginx we can define access (allow/deny) rules as follows:

allow   192.168.1.0/24;
allow   10.1.1.0/1

However when we want to use wildcard for last 2 segments of an IP address,

allow 192.168.0/255.0/255

that does not work and it says this syntax is incorrect. What is the way to do that? Is it impossible because two segments mean different subnets or what? An explanation about this would be a great resource for future, I assume.

share|improve this question

1 Answer 1

up vote 4 down vote accepted
allow 192.168.0.0/16;

Your 10.1.1 rule is wrong, what are you trying to accomplish with it?

The syntax is CIDR network numbering.

share|improve this answer
    
Wrong rule is in nginx documentation as you can see. –  Ahmet Alp Balkan Nov 8 '11 at 11:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.