Forum Discussion

P_Kueppers_3614's avatar
P_Kueppers_3614
Icon for Nimbostratus rankNimbostratus
Oct 22, 2018

Bug in VS redirect with HTML iRule?

Hi,

 

we use the iRule for serving "Error 503 Service Unavailable" HTML page. In all virtual servers we got this iRule which is triggered if the pool is down. This works quite well in all browsers.

 

We use one virtual server for multiple domains and redirect them to the right pool with policies. If the pool is down, the iRule get triggered

 

The last policy is an "catch all" for everything not beeing filtered. So all other Traffic goes to an VS with a offline pool and that iRule so the idea behind this is, everything which is not redirected to a pool get the Error 503 page from the iRule (eg. open up the IP Adress).

 

This is the problem: It works in every browser expect in Chrome and Safari. See Screenshot below.

 

Same behavior in Safari under OS X. IE and Firefox on Windows and Mac renders like it should.

 

So when the traffic is redirected to an virtual server and the iRule is triggered the html code is broken for chrome?! I dont get this :D

 

3 Replies

  • You might want to share your iRule so we can see what you are doing and see if someone can help.

     

  • when HTTP_REQUEST {
        if { [active_members [LB::server pool]] < 1 } {
        log local0. "Client [IP::client_addr] requested Host: [HTTP::host] with URI: [HTTP::uri] accessed [virtual] but no active nodes available..."
    
            switch [HTTP::uri] {
                "/Logo.png" {
                                    HTTP::respond 200 content [ifile get "Logo.png"] "Content-Type" "image/png" "Cache-Control" "no-cache, must-revalidate"
                                    }
            default { 
                        HTTP::respond 503 content {
    
    
    
    
    Error 503 Service Unavailable
    
    
     Service Unavailable 
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
    
    
    
            }
          }
        }
      }
    }
    
  • I think this is because you have a new line as the first line of the

    HTTP::respond
    content which is then seen just as text by Safari and Chrome. I have tried to replicate it using Chrome but not able to

    Try the following and let us know if it is any better:

    when HTTP_REQUEST {
        if { [active_members [LB::server pool]] < 1 } {
        log local0. "Client [IP::client_addr] requested Host: [HTTP::host] with URI: [HTTP::uri] accessed [virtual] but no active nodes available..."
    
            switch [HTTP::uri] {
                "/Logo.png" {
                                    HTTP::respond 200 content [ifile get "Logo.png"] "Content-Type" "image/png" "Cache-Control" "no-cache, must-revalidate"
                                    }
            default { 
                        HTTP::respond 503 content {
    
    
    
    Error 503 Service Unavailable
    
    
     Service Unavailable 
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
    
    }
          }
        }
      }
    }