Forum Discussion

Jim_1600's avatar
Jim_1600
Icon for Nimbostratus rankNimbostratus
May 24, 2011

Is there a way to capture an inbound URL and pass it along?

As an app developer, I have a situation were our app server needs to know the original inbound URL that was used to hit F5, in order to avoid triggering a "same origin policy".

 

 

 

Presently, the flow looks something like this:

 

 

 

original-client.inbound.url --> F5 (mapped to: some.targeted.server.url) --> application on targeted server needs the "original-client.inbound.url", but only has "some.targeted.server.url" on the request header.

 

 

 

Is it possible to configure F5 to capture the original inbound URL and pass it along (as a header item or new url parameter) to the app server that F5 has targeted?

 

 

 

 

 

Thanks

 

  • Hi Jim,

     

     

    You can insert a cookie using HTTP::cookie insert and a header using HTTP::header insert in the HTTP_REQUEST event:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/http__cookie

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/http__header

     

     

    You can get the requested host using [HTTP::host] and the URI using [HTTP::uri]. If you're inserting something in a cookie, you should consider URI (percent) encoding it:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/http__host

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/http__uri

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/uri__encode

     

     

    If you get stuck, let us know what you've tried and what issue(s) you're seeing. If you have an anonymized example of the original request headers you expect from the client and what you'd like the modified request to look like, we could give you a more exact example iRule.

     

     

    Aaron