Forum Discussion

Justin_Huff_481's avatar
Justin_Huff_481
Icon for Nimbostratus rankNimbostratus
Sep 08, 2008

Keep-Alive on the client but not server side

I have a backend app that doesn't like http keep-alive/persistent connections. However, I'd really like the client to do persistent connections to the LB. The LB would then make non-persistent http connections to the backend.

 

 

Is there a way to do this?

 

 

thanks!
  • Did you get an answer to your question? I'd like to know the configuration settings you used for it.

     

    thanks,

     

    victor
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    You can try forcing the serverside to HTTP/1.0 as we do to prevent chunking (another 1.1-only behaviour):
           Don't allow data to be chunked 
           if { [HTTP::version] eq "1.1" } { 
              if { [HTTP::header is_keepalive] } { 
                 HTTP::header replace "Connection" "Keep-Alive" 
              } 
              HTTP::version "1.0" 
           }

    /d
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    oops, looks like you'd want to change "Keep-Alive" to "Close" in the header replacement line
  • I have a similar question. We have a backend application that keeps closing the TCP connection after each HTTP get, even though 1.1 is in use and the client requests Keep-Alive. If we find that we can't modify this behavior by the app, can we configure LTM to rewrite the response "Connection: close" with a "Connection: Keep-Alive" so that the client does not tear down the session to the LTM?