Redirect IP Public

rodrigoshrodrigosh Member

Hello, I need your guide for a query I have.

I want to perform a redirect to block access to a public IP that I have in the balancer + URI, but I can't create aFlex. Can this be done?

Comments

  • rodrigoshrodrigosh Member

    Yes, but how can I do it to take the request when it comes with an IP, less so https://200.125.55.34/URI I need to redirect that request

  • john_allenjohn_allen Member

    So you need to match on the Host AND the URI? You will have to use a comparison for the Host AND the URI parts. HTTP::host and HTTP:uri will return those parts of the request. The Host being an IP address verses an FQDN does not matter...you can match either of those.

  • rodrigoshrodrigosh Member
    edited May 2023

    Unfortunately I don't have a HOST or FQDN, it's only published by IP and URI and I want to redirect it elsewhere, I don't know if it will be possible.

  • rodrigoshrodrigosh Member

    I was able to do the redirect, only with the URI of the site, regardless of whether it comes with HOST or IP, this is how I built it.

    when HTTP_REQUEST {

    if { [HTTP::uri] equals "/URI/*" } {

    HTTP::redirect https://misitio.otro.com

     

    }

    }

  • dquinndquinn Member

    maybe a little late but you can accomplish this with a slb http template

    example:

    slb template http redir 

      redirect location https://misitio.otro.com 


    output from curl

    < HTTP/1.1 302 Found

    < Location: https://misitio.otro.com

    < Connection: close

Sign In or Register to comment.