This article is provide steps to insert X-Forwarded-Proto http header to the request.
The X-Forwarded-Proto
header used for identifying the protocol (HTTP or HTTPS) that a client used to connect to load balance Vserver.
We have to create to policy to check protocol used by the client to insert header which will be executed consecutively.
- Configure action to insert http header X-Forwarded-Proto.
> add rewrite action insert_act_HTTP_X_FORWARDED_PROTO insert_http_header X-Forwarded-Proto "\"http\""
- Configure a policy to check the protocol client is using to connect to the vServer using the expression highlighted below
> add rewrite policy insert_pol_HTTP_X_FORWARDED_PROTO !CLIENT.SSL.IS_SSL insert_act_HTTP_X_FORWARDED_PROTO
- Bind policy to the vServer with action next to check if client is using the https protocol with priority higher than http policy and gotoPriorityExpression END
> bind lb vserver RGB_SSL -policyName insert_pol_HTTP_X_FORWARDED_PROTO -priority 100 -gotoPriorityExpression NEXT -type REQUEST
- Make similar configuration to check if client is using HTTPs protocol and bind the policy to vServer with priority lesser than http policy and gotoPriorityExpression END
add rewrite action insert_act_HTTPs_X_FORWARDED_PROTO insert_https_header X-Forwarded-Proto "\"https\""
add rewrite policy insert_pol_HTTPs_X_FORWARDED_PROTO CLIENT.SSL.IS_SSL insert_act_HTTPs_X_FORWARDED_PROTO
bind lb vserver RGB_SSL -policyName insert_pol_HTTPs_X_FORWARDED_PROTO -priority 110 -gotoPriorityExpression END -type REQUEST