Forum Discussion

Shamsul_Alam_34's avatar
Shamsul_Alam_34
Icon for Nimbostratus rankNimbostratus
Nov 14, 2017

redirect IIS 500 error to another host in pool

Hi expert,

 

I need help to configure my F5 LTM to redirect the connection to another host in the pool when one of the host/node in the pool have internal server error 500. How can i redirect the request to another host in F5 LTM when hit this internal error?

 

Thanks

 

13 Replies

  • Hi, if you set up an HTTP monitor to check for an HTTP status code of 200, any pool member serving a 500 will not be selected for load balancing

     

  • here is the output:

    [root@f5:Active:Standalone] config  curl -s -v  172.16.5.76 1> /dev/null
    * About to connect() to 172.16.5.76 port 80 (0)
    *   Trying 172.16.5.76... connected
    * Connected to 172.16.5.76 (172.16.5.76) port 80 (0)
    > GET / HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.1l zlib/1.2.3 libidn/1.18
    > Host: 172.16.5.76
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Content-Type: text/html
    < Last-Modified: Thu, 13 Apr 2017 19:11:24 GMT
    < Accept-Ranges: bytes
    < ETag: "31cc9dbe89b4d21:0"
    < Server: Microsoft-IIS/10.0
    < X-Powered-By: ASP.NET
    < Date: Wed, 15 Nov 2017 20:15:47 GMT
    < Content-Length: 703
    <
    { [data not shown]
    * Connection 0 to host 172.16.5.76 left intact
    
    • Lee_Sutcliffe's avatar
      Lee_Sutcliffe
      Icon for Nacreous rankNacreous

      That looks fine. Try just putting

      200 OK
      in the receive string. Any issues please output the tmsh/cli monitor config:

    • Shamsul_Alam_34's avatar
      Shamsul_Alam_34
      Icon for Nimbostratus rankNimbostratus

      Still failed. No clue what going wrong here.

       

      My monitor setting as below:

       

      Node setting

       

      Pool setting

       

    • Lee_Sutcliffe's avatar
      Lee_Sutcliffe
      Icon for Nacreous rankNacreous

      Could you change your node monitor to gateway_icmp and remove https_443 from the pool so you're only using the Check_header_200-OK monitor

       

  • If you want allow additional status codes 301 and 302, you could do it as below in the receive string.

    (200 OK|301|302)
    
  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    You need specify the HTTP version in your send string if your backend does not support HTTP/0.9:

    GET / HTTP/1.0\r\n\r\n

    .

  • Create a http monitor with alias port 80

    send string:
    GET / HTTP/1.1\r\nHost:\r\nConnection: Close\r\n\r\n
    

    Receive string:

    HTTP/1.[01] [23]0[0-6]
    

    And enable it on your pool (please remove the other monitors)

    Cheers,

    Kees