You can use HTTP security policies to define actions such as allowing or denying a connection, redirecting to HTTPS, or responding with a static page.

Procedure

  1. From the top navigation bar, select Resources and click Cloud Resources.
  2. In the left panel, click Edge Gateways.
  3. Click the NSX edge gateway, and under Load Balancer, click Virtual Services.
  4. Click the vertical ellipsis () on the left of the virtual service name and select Configure Policies.
  5. Click HTTP Security, and click New.
  6. Enter a name for the rule.
  7. To activate the rule upon creation, toggle on the State option.
  8. Under Match Criteria, click New.
  9. Select one or more match criteria and enter the necessary input.
    Match Criteria Input
    Client IP Address
    1. Select whether to perform an action if the client IP matches or doesn't match the value that you enter.
    2. Enter an IPv4 address, or an IPv6 address, or a range, or a CIDR notation.
    3. (Optional) To add additional IP addresses, click Add IP.
    Service Port
    1. Select whether to perform an action if the virtual service port matches or doesn't match the value that you enter.
    2. Enter a port or a list of ports in a comma-separated list.
    Protocol Type Select a type of protocol.
    HTTP Method
    1. Select whether to perform an action if the HTTP method matches or doesn't match the value that you enter.
    2. Select one or more HTTP methods used by the client request.
    Path
    1. Select a criteria for the path.
    2. Enter a path string.
      Note: The path doesn't need to begin with a forward slash ( / ).
    3. (Optional) To add additional paths, click Add Path.
    Query
    1. Enter text that is part of a query string.
    2. (Optional) To enter additional queries, click Add Query.
    Request Headers
    1. Select a criteria for the request header.
    2. Enter a name for the header.
    3. Enter one or more values for the header.
    4. To add additional headers, click Add Header.
    Cookie
    1. Select a criteria for the cookie.
    2. Enter a name for the cookie.
    3. Enter a value.
  10. Select an action to perform upon a match.
    Action Input
    Connection Select whether to allow or to close the connection.
    Rate Limit
    1. Enter a maximum number of connections, requests or packets to allow for a period of time.
    2. Enter a value for the time period in seconds.
    3. Select an action to perform when the maximum count of requests within the specified period of time is reached.
    Redirects to HTTPS Enter an HTTPS port to redirect HTTP requests.
    Send Response Select a status code and, optionally, upload a file to render in response.
  11. Click Add.
  12. To add another rule, repeat steps 6 through 12.
  13. To move a rule up or down the list, click the vertical ellipsis () on the left of the rule name and select the desired action.
  14. To save your changes, click Save.