Jump to content
Welcome to our new Citrix community!

apache to netscaler


Recommended Posts

I have the following expession on a apache server and I need to traslate to a netscaler

 


    Header set Access-Control-Allow-Credentials "true"
    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS, HEAD,"
    Header set Access-Control-Allow-Headers "accept,x-requested-method,origin
    Header set Access-Control-Expose-Headers "DS-Request-ID,X-DS-CSRFTOKEN"
    Header set Access-Control-Max-Age "600"

 

 

Link to comment
Share on other sites

Hi!

 

You can do this in a 1 line rewrite action/policy , like this :

 

add rewrite action rw_act_header_response insert_after HTTP.RES.FULL_HEADER.BEFORE_STR("\r\n\r\n") "\"\r\nAccess-Control-Allow-Credentials: true \r\nAccess-Control-Allow-Headers: accept,x-requested-method,origin \r\nAccess-Control-Allow-Methods: GET,POST,OPTIONS,HEAD \r\nAccess-Control-Expose-Headers: DS-Request-ID,X-DS-CSRFTOKEN \r\nAccess-Control-Max-Age: 600 \r\n \"" 

 

add rewrite policy rw_pol_header_response TRUE rw_act_header_response

 

 

Then you bind the policy to whatever vip you want.

I am guessing you want to do this on the RESPONSE side that gets delivered to the client.

 

 

 

 

Link to comment
Share on other sites

or if you want you can have a action/policy for each header:

 

add rewrite action insert_header_1 insert_http_header Access-Control-Allow-Credentials "\"true\""
add rewrite action insert_header_2 insert_http_header Access-Control-Allow-Methods "\"GET,POST,OPTIONS,HEAD\""
add rewrite action insert_header_3 insert_http_header Access-Control-Allow-Headers  "\"accept,x-requested-method,origin\""
add rewrite action insert_header_4 insert_http_header Access-Control-Expose-Headers  "\"DS-Request-ID,X-DS-CSRFTOKEN\""
add rewrite action insert_header_5 insert_http_header Access-Control-Max-Age "\"600\""

 

add rewrite policy insert_header TRUE insert_header_1
add rewrite policy insert_header TRUE insert_header_2
add rewrite policy insert_header TRUE insert_header_3
add rewrite policy insert_header TRUE insert_header_4
add rewrite policy insert_header TRUE insert_header_5

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...