Forum Discussion

Jim_Mathers_131's avatar
Jim_Mathers_131
Icon for Nimbostratus rankNimbostratus
Jul 09, 2018

Simplest way to insert "Strict-Transport-Security: max-age=63072000" for all HTTP responses

Hey folks, what is the easiest way to insert that header on an HTTPS vip where we are offloading SSL?

 

Thanks, Jim

 

1 Reply

  • How about something like below? This solution checks to make sure the server is not already sending one before inserting the default.

    when HTTP_RESPONSE {
         If server has not sent an HSTS header, BIG-IP will
        if { !([HTTP::header exists "Strict-Transport-Security"]) } {
            HTTP::header insert "Strict-Transport-Security" "max-age=63072000"
        }
    }