Forum Discussion

itinneed's avatar
itinneed
Icon for Nimbostratus rankNimbostratus
Jul 25, 2023

F5 receive string for a 302 redirect?

I connected to my LTM and ran the steps from this guide: 

 

 

telnet xxx.xxx.xxx.178 80
Trying xxx.xxx.xxx.178...
Connected to xxx.xxx.xxx.178.
Escape character is '^]'.
GET / HTTP/1.1
Host: my.host.com/dia/sec
Connection: close

HTTP/1.0 302 Moved Temporarily
Location: https://my.host.com/dia/sec
Server: BigIP
Connection: close
Content-Length: 0

 

 

So following that, I followed the guide and created this send string:

 

 

GET /dia/sec HTTP/1.1\r\nHost: my.host.com\r\nConnection: Close\r\n\r\n

 

 

But what is my receive string supposed to look like? I've tried:

 

 

HTTP/1.(0|1) (2|302)

 

 

But that just returns a down status.

    • itinneed's avatar
      itinneed
      Icon for Nimbostratus rankNimbostratus

      For some reason, this continues to work with my site after we take tomcat down. Curl -I gives an error code of 503 but http keeps returning 302.

      • whisperer's avatar
        whisperer
        Icon for MVP rankMVP

        You may need to monitor a different resource. Keep in mind that a server technology like Apache can continue to run and repsond to HTTP even though Tomcat and its ability to serve java content are down.

  • I was a bit tired last night and didnt see that you were asking about the receive string. Provided you with the send string. Generally for health monitors, I try to figure out what is the 'final resource' after all redirects and just monitor that. So since the web server responded with HTTP 1.0 and provides the redirect, I adjusted the send string accoringly. Now... if you do use that proposed send string, you should be receiving a standard HTTP 200 as that is the final resource and not a redirect (if that makes any sense). So at that point, you could simply check for any response really, or just the default nothing in the receive string or HTTP/1.0 200. KeesvandenBos provided a generic receive string that would match on ANY HTTP code response from the server, redirect or otherwise. Perhaps this is what you are looking for? However, I prefer to be more fine grained and monitor the actual final URL.