You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/stackpath-service/stackpath-sites-edgerules.md
+37-15Lines changed: 37 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -12,35 +12,46 @@ that inspect requests to see if they match certain conditions, and matching requ
12
12
13
13
Required permissions
14
14
15
-
Navigate to
15
+
Navigate to the StackPath service, click on *Sites*, and click on the desired site. When the *Overview* page appears, click on the *EdgeRules* item on the left.
16
16
17
17
### View EdgeRules
18
18
19
-
### Predeined EdgeRules
19
+
### Predefined EdgeRules
20
20
21
21
#### Force WWW connections
22
22
#### Custom robots.txt file
23
23
#### Pseudo-streaming
24
24
#### Referrer protection
25
25
26
+
StackPath provides four commonly used rules as predefined EdgeRules.
27
+
26
28
-**Force WWW connections:** redirect http://acme.com to http://www.acme.com. Be aware that this would redirect http://portal.acme.com to http://www.portal.acme.com.
27
29
-**Custom robots.txt file:** easily create and maintain a robots.txt file through the ui
28
30
-**Pseduo-streaming:** Allows a client to specify a seek point in a file.
29
31
-**Referrer protection:** Allows you to specify a set of domains from which users will be allowed to connect from, as identified by the `Referer` header. You can choose to allow empty referer headers. Requests not meeting these conditions will be blocked.
30
32
31
-
### Create a custom EdgeRule
33
+
### Custom EdgeRules
34
+
35
+
The predefined EdgeRules cover only a small set of cases. You can create custom EdgeRules to specifically target traffic that is of interest to you.
32
36
33
37
The interface will present a text field for the name. A condition type can be selected. Upon selecting a condition type, the interface will display the options appropriate for the condition type. Additionally, once a condition type is selected, the interface will display an action to select for the EdgeRule. Depending on the selected action, the interface will show the appropriate options for the action.
34
38
35
39
### EdgeRule conditions
36
40
37
-
Conditions may use five different attributes for an EdgeRule.
41
+
Conditions may inspect one of five different attributes for an EdgeRule.
42
+
43
+
-**URL:** The EdgeRule will to attempt to match a search pattern against the URL, which includes the protocol, hostname, path, and query parameters. When defining the pattern, you may use:
44
+
- A **simple string** for a direct match. If the exact string is found in the URL, the pattern will match. The asterisk (*) may be used as a wildcard to match zero or more characters.
45
+
- A **regular expression**. The pattern should be enclosed within a pair of forward slashes (/). If the regular expression finds at least one match, the condition will be triggered.
46
+
-**Header:** Looks at entire header line.
47
+
- A **simple string** for a direct match. If the exact string is found in the header line, the pattern will match. The asterisk (*) may be used as a wildcard to match zero or more characters.
48
+
- A **regular expression**. The pattern should be enclosed within a pair of forward slashes (/). If the regular expression finds at least one match, the condition will be triggered.
49
+
-**HTTP method:** Match against the request method. Select one or more methods from the popup menu.
50
+
-**Status code:** Comma-separated list of HTTP status codes.
51
+
-**Cookie:** Looks at cookie name and value.
52
+
- A **simple string** for a direct match. If the exact string is found in the cookie, the pattern will match. The asterisk (*) may be used as a wildcard to match zero or more characters.
53
+
- A **regular expression**. The pattern should be enclosed within a pair of forward slashes (/). If the regular expression finds at least one match, the condition will be triggered.
38
54
39
-
-**URL:**
40
-
-**Header:**
41
-
-**HTTP method:**
42
-
-**Status code:**
43
-
-**Cookie:**
44
55
45
56
### EdgeRule actions
46
57
@@ -55,24 +66,28 @@ An EdgeRule may specify one of four general types of actions to execute when the
55
66
56
67
1. Add response header
57
68
- Added to response from CDN to end user
58
-
- Put the header name into the Key field.
69
+
- Enter the header name into the **Key** field.
70
+
- Enter the desired value in to the **Value** field
59
71
1. Add header to CDN
60
72
- Add to request from user to CDN
61
-
- Put the header name into the Key field
73
+
- Enter the header name into the **Key** field.
74
+
- Enter the desired value in to the **Value** field
62
75
1. Add header to origin
63
76
- Add to request from CDN to origin server
64
-
- Put the header name into the Key field
77
+
- Enter the header name into the **Key** field.
78
+
- Enter the desired value in to the **Value** field
65
79
1. Modify header
66
80
- Modify value of existing header <- Where? In the request?
67
-
1.Remove header
81
+
1.Hide header
68
82
- From where? The request?
69
-
-Seems like you can use this to replace the value in the header.
83
+
-Enter the name of the header to hide in the **Header** field
70
84
71
85
#### Caching rules
72
86
73
-
1. Cache
87
+
1. Cache -- specify a TTL
74
88
1. Do not cache
75
89
1. Never expire
90
+
1. Bypass cache -- How is this different from Do not cache? The only example in the SP// docs I can find is https://stackpath.dev/docs/bypass-cache-on-url, which uses Do not cache lol
76
91
77
92
#### Redirect rules
78
93
@@ -84,6 +99,13 @@ Not clear what happens here?
84
99
85
100
URL Signing policies allow you to restrict access to your content by configuring a "shared secret" with StackPath. This "shared secret" is used to apply an MD5 hashing algorithm on the URL to validate the signature supplied on the request. Since the "shared secret" is only known by the publisher and StackPath, URL signatures cannot be generated by unauthorized users.
0 commit comments