Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit a23a777

Browse files
committed
Make pagerule example more readable
1 parent ee50578 commit a23a777

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

examples/example-page-rules.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
:
22

3-
cli4 -v --post \
4-
targets='[ { "target": "url", "constraint": { "operator": "matches", "value": "*.example.com/url1*" } } ]' \
5-
actions='[ { "id": "forwarding_url", "value": { "status_code": 302, "url": "http://example.com/url2" } } ]' \
3+
ZONE=${1-example.com}
4+
5+
URL_MATCH="*.${ZONE}/url1*"
6+
URL_FORWARDED="http://${ZONE}/url2"
7+
8+
cli4 --post \
9+
targets='[ { "target": "url", "constraint": { "operator": "matches", "value": "'${URL_MATCH}'" } } ]' \
10+
actions='[ { "id": "forwarding_url", "value": { "status_code": 302, "url": "'${URL_FORWARDED}'" } } ]' \
611
status=active \
712
priority=1 \
8-
/zones/:exmaple.com/pagerules | jq '{"status":.status,"priority":.priority,"id":.id}'
13+
/zones/:${ZONE}/pagerules | jq '{"status":.status,"priority":.priority,"id":.id}'
914

1015
exit 0
1116

0 commit comments

Comments
 (0)