Yes, OneConnect disconnects the serverside connection for a 404 response. This is noted in bz365822. I’m not sure what the logic is for this, but you can work around it by using a simple iRule:
when HTTP_RESPONSE {
ONECONNECT::reuse enable
}
You could request that the logic be improved in a Support case.
So according to F5 support since v11.2 there is a BigDB variable tmm.http.oc.droponerror controlling whether OneConnect will drop the server-side connection if there is a 404 and most other HTTP errors in Response (enabled by default). Posting this on DevCentral so it becomes public knowledge - I could not find documentation about this BigDB entry anywhere in LTM documentation
tmsh show running-config sys db tmm.http.oc.droponerror
sys db tmm.http.oc.droponerror {
value "true"
}