Ipfilter exception path


(xincun) #1

Does ipfilter support exception paths?

ipfilter /api/users { 
    rule allow
    ip 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8
}

/api/users only allow LAN access, /api/users/1 this path requires public network access.
How to achieve?


(Matthew Fay) #2

I don’t see any capability like that in ipfilter.

You could achieve this functionality on a case-by-case basis with separate site definition blocks:

example.com {
  root /var/www/html
  ipfilter /api/users {
    rule allow
    ip 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8
  }
}
example.com/api/users/1 {
  root /var/www/html/api/users/1
}

(xincun) #3

Thx for your help.