Help us improve the AWS re:Post Knowledge Center by sharing your feedback in a brief survey. Your input can influence how we create and update our content to better support your AWS journey.
選擇 Add my own rules and rule groups (新增我自己的規則和規則群組)。
新增以下值來設定您的規則:
在 Rule type (規則類型) 中,選擇 Rule Builder (規則建置器)。
在 Name (名稱) 中,輸入規則的名稱。
在 Type (類型) 中,選擇 Regular rule (一般規則)。
在 If a request (如果請求) 中,選擇 Matches the statement (比對陳述式)。
針對檢查,選擇單一標頭。
在 Header field name (標頭欄位名稱),選擇 Host (主機)。
在 Match type (比對類型),選擇 Exactly matches String (完全相符字串)。
在 String to match (要比對的字串) 中,選擇主機名稱。
(選用) 選擇 Text transformation (文字轉換),或選擇 None (無)。
在 Action (動作) 中,選擇 Allow (允許)。
選擇 Add Rule (新增規則)。
在 Set Rule Priority (設定規則優先順序) 中選取您的規則,然後更新其優先順序。如需詳細資訊,請參閱設定規則優先順序。
在 Rule Type (規則類型),選擇 Custom rule (速自訂規則),然後選取 Next (下一步)。
新增以下值來設定您的規則:
在 Rule type (規則類型) 中,選擇 Rule Builder (規則建置器)。
在 Name (名稱) 中,輸入規則的名稱。
在 Type (類型) 中,選擇 Regular rule (一般規則)。
在 If a Request (如果請求) 中,選擇 Doesn't match the statement (NOT) (與陳述式不符 (NOT))。
針對檢查,選擇單一標頭。
在 Header field name (標頭欄位名稱),選擇 Host (主機)。
在 Match type (比對類型),選擇 Exactly matches String (完全相符字串)。
在 String to match (要符合的字串),選擇您的主機名稱,以封鎖除該主機名稱以外的所有流量。
(選用) 選擇 Text transformation (文字轉換),或選擇 None (無)。
在 Action (動作) 中,選擇 Block (封鎖)。
選擇 Add Rule (新增規則)。
在 Set Rule Priority (設定規則優先順序) 中選取您的規則,然後更新其優先順序。如需詳細資訊,請參閱設定規則優先順序。
選擇 Save (儲存)。
最佳實務是使用邏輯規則陳述式,將字串比對陳述式與其他陳述式類型 (例如 IP 集比對和地理位置比對) 結合起來。