book
Article ID: CTX237134
calendar_today
Updated On:
Description
A sample to set http response header X-Frame-Options by rewrite policy on vpn vserver
Instructions
What's X-Frame-Options
Please refer to following information for details:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Steps
- Add rewrite action and policy to delete current header
- Add rewrite action and policy to insert the target header
- Bind the delete and insert policy to the vpn vserver
Command line sample in CLIFollowing command lines are to set the header X-Frame-Options in the response to DENY for vpn vserver
_VPN_GW_Name add rewrite action rw-act-delete-x-frame delete_http_header X-Frame-Options
add rewrite action rw-act-insert-x-frame insert_http_header X-Frame-Options "\"DENY\""
add rewrite policy rw-pol-delete-x-frame HTTP.RES.IS_VALID rw-act-delete-x-frame NOREWRITE
add rewrite policy rw-pol-insert-x-frame HTTP.RES.IS_VALID rw-act-insert-x-frame NOREWRITE
bind vpn vserver _VPN_GW_Name -policy rw-pol-delete-x-frame -priority 100-gotoPriorityExpression NEXT -type RESPONSE
bind vpn vserver _VPN_GW_Name -policy rw-pol-insert-x-frame -priority 110 -gotoPriorityExpression NEXT -type RESPONSE
Issue/Introduction
How to replace the value of Header X-Frame-Options from SAMEORIGIN to ALLOW-FROM