[GCP] Cloud Armor Allow IP Address With Spec Path
Situation
How To Setting Specific Path Only Allow Some IP.
Component
-
A Instance With Nginx
-
External Load Balancer
-
Cloud Armor
How To
Before Setting Cloud Armor, I Can Visit /, /path1/ And /Path2/ Without Cloud Armor.
Load Balancer Information
Root Path
/path1/
/path2/
Setting Cloud Armor
Create Policy And Setting Default Rule
Add New Rule And Setting In Advanced mode
Enter regex
inIpRange(origin.ip, '<allow_ip_address>') && request.path.maches('<path>')
In This Case, I Just Allow Visit /path1/, The root path & /path2/ Are Use Default deny Rule.
We’ll Visit After Setting And Wait About 5 - 10 Mins.
Root Path
/path1/
/path2/