Forum Discussion

F5Hopper_28651's avatar
F5Hopper_28651
Icon for Nimbostratus rankNimbostratus
Sep 10, 2015

301 redirect in chrome issue

I have tried about three versions and still get the same issue..

In chrome, it works just fine the first time...then if I try again without closing chrome it just spins to no end.

it works fine in IE....

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] equals "qa.client.abc.com" } {
        HTTP::respond 301 Location "https://qa.client.800abc.com"
    }
}

Thanks

12 Replies

  • yah, it works just fine.. is this normal? in testing again... now all browsers spin..hmm
  • Try it with

    curl
    from a shell and see if you get the Location header you're expecting:

    curl -ski -o- http://qa.client.abc.com
    

    You should see the HTTP response header, then the new location:

    HTTP/1.0 301 Found
    Location: https://qa.client.800abc.com
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    

    If you get something else, it might explain strange behavior from Chrome. If you get something like the above, I think it's working correctly.

    • DevBabu's avatar
      DevBabu
      Icon for Cirrus rankCirrus
      It's returning perfectly for me: [root@localhost named] curl -ski http://qa.client.abc.com HTTP/1.0 301 Moved Permanently Location: https://qa.client.800abc.com Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@localhost named]
  • Do you have a virtual server that's handling traffic for qa.client.abc.com? Is it listening on port 80?

     

    Is there, perhaps, a typo in your example? One line in your code uses the domain "abc.com", and the other "800abc.com". Are you just trying to redirect HTTP to HTTPS, or are you trying to change the domain, too?

     

  • the old working URL was qa.client.abc.com both HTTP and HTTPS. I removed the pool and added the irule above for both HTTP and HTTPS. the new site qa.client.800abc.com is fully working on its own. this setup is on an old LTM 1500, BIG-IP 10.2.0 Build 1789.0 Hotfix HF2

     

    • oshaughnessy_19's avatar
      oshaughnessy_19
      Icon for Nimbostratus rankNimbostratus
      Add the `-v` flag to curl: curl -v -ski -o- http://qa.client.abc.com * getaddrinfo(3) failed for qa.client.abc.com:80 * Couldn't resolve host 'qa.client.abc.com' * Closing connection 0 It doesn't resolve for me, but perhaps it works for you within your data center.
  • ok it might help to have a DNS server added....

    [admin@bip1:Active] ~  curl -ski -o- http://qa.client.abc.com
    HTTP/1.0 301 Moved Permanently
    Location: https://qa.client.800abc.com
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    
    [admin@bip1:Active] ~ 
    
    • oshaughnessy_19's avatar
      oshaughnessy_19
      Icon for Nimbostratus rankNimbostratus
      Nice. That looks like the right response. Do you get the same when you run it from your computer (or wherever you're running Chrome)?
  • Have you taken any capture on your PC to see what it get's back in return from F5 LTM. Wireshark or some Fiddler capture.

    For me it is working perfectly

    [root@localhost named] curl -ski http://qa.client.abc.com
    HTTP/1.0 301 Moved Permanently
    Location: https://qa.client.800abc.com
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    
    [root@localhost named]
    
  • I did check Fiddler, didn't see anything standing out... I also setup another VirtualServer on another domain and added a version of the irule and it routed just fine... maybe the host server or site is being funny... I'm going to add the qa.client.*** to the new VitualF5 I have and test again.