Forum Discussion
Andy_V_137639
Nov 13, 2013Nimbostratus
Getting around CORS with IRULES
Our website uses AJAX requests that makes requests from a page delivered from VIP A (www.acmecorp.com) to send requests to VIP B (api.acmecorp.com). We had to go ahead and put in a bunch of headers ...
- Nov 13, 2013
you can use the ProxyPassV10 irule for this.
your datagroup content would look like this: www.acmecorp.com/api/ api.acmecorp.com/ pool_api_servers
the virtual server's default pool should be the one for the www.acmecorp.com servers and you must use a oneconnect profile in the VS as well.
the proxypass irule will rewrite any request going to www.acmecorp.com/api/XYZ to api.acmecorp.com/XYZ and send it to the pool pool_api_servers proxypass will also take care of the location header in http redirects and rewrite it for you.
Andy_V_137639
Nov 13, 2013Nimbostratus
Am I on the right track here?
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/api" } {
HTTP::uri [string map {"/api" ""} [HTTP::uri]]
virtual API_VIP
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects