2 Replies Latest reply on Jan 3, 2017 7:30 PM by Bayu Wibowo

    NSX Load Balancer: Changing requests to http://foo.com to https://foo.com

    vmmedmed Novice

      The documentation and HA Proxy guide seem to be showing me to many use cases. I just have the very simple case

      where I have a Virtual Server setup for https://foo.com. But in the event that someone happens to type in http://foo.com

      I want direct them to https://foo.com. What are the minimum number of statements in an Application Rule in order

      to be able to accomplish this? Thank you.


      The example int he documentation is below. But that looks to me like it's more than I need.


      HTTP/HTTPS redirection based on condition

      An application profile allows you to specify HTTP/HTTPS redirection, which always redirects traffic regardless of the request URLs. You also have the flexibility to specify the conditions in which HTTP/HTTPS traffic should be redirected.

      move the login URL only to HTTPS.

      acl clear dst_port 80

      acl secure dst_port 8080

      acl login_page url_beg /login

      acl logout url_beg /logout

      acl uid_given url_reg /login?userid=[^&]+

      acl cookie_set hdr_sub(cookie) SEEN=1

      redirect prefix https://mysite.com set-cookie SEEN=1 if !cookie_set

      redirect prefix https://mysite.com if login_page !secure

      redirect prefix http://mysite.com drop-query if login_page !uid_given

      redirect location http://mysite.com/ if !login_page secure

      redirect location/ clear-cookie USERID= if logout


      NSX 6 Documentation Center