I know 2nd rule is not applicable in this case because we have used “*” in first Rule, and not sure if X-Forwording rule is trying something which fails request sometimes.
rule x-forwarding_Rule
when HTTP_REQUEST { HTTP::header insert X-Forwarded-For [IP::remote_addr] } }
It looks like you are intending to match based on URI but your iRule is matching on both host header & URI: [string tolower [HTTP::host][HTTP::uri]]. If my understanding is right, you should use [string tolower [HTTP::uri]]
If you any CDN traffic, try using OneConnect with /32 netmask.
header for every incomming requests if you continue to
HTTP::redirect
every single requests.
The
X-Forwarded-For
header has no benefits for
HTTP::redirects
and even worse it will just disrupt the ongoing TCP session if you try to manipulate the HTTP request after it has been already responded. In addition you will see the error message below in your LTM logs…
Operation not supported (line 1) invoked from within "HTTP::header insert X-Forwarded-For [IP::remote_addr]"