Forum Discussion
Craig_Freyman_1
Nimbostratus
Nov 07, 2005Masking URL
So I've got a number of VIP's going into the BIGIP. Each VIP has a URL associated with it. We use these different URLs to manipulate the traffic in different ways before the traffic is sent back to a single Macromedia Breeze server.
Breeze is configured to only listen to requests for: breeze.domain.com
I have a few other domains:
1. nocache.domain.com
2. performance.domain.com
I need both of these domains to be sent back to the breeze server as if they were going to breeze.domain.com - and it would be nice if the user didnt notice any of this.
Is there a way to send traffic to the Breeze server so it thinks all traffic is going to breeze.domain.com ?
I've tried using the HTTP::header replace Host breeze.domain.com in an IRule but it isnt really working. Any ideas out there?
25 Replies
- Craig_Freyman_1
Nimbostratus
I think the problem might be related to the cookies the system uses. For example, here is a request to the regular URL that works fine:
GET /?handler=/system/login/ok&login=craig.freyman@medpt.com&password=&next=/freyman/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: conference2.telept.com
Connection: Keep-Alive
HTTP/1.0 302 Moved Temporarily
Set-Cookie: BREEZESESSION=breez834z9ihgsza8zzdi;path=/
Expires: now
Server: JRun Web Server
Date: Tue, 08 Nov 2005 17:42:37 GMT
Content-Length: 0
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Location: http://conference2.telept.com/freyman/
GET /freyman/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: conference2.telept.com
Connection: Keep-Alive
Cookie: BREEZESESSION=breez834z9ihgsza8zzdi
HTTP/1.1 200 OK
Date: Tue, 08 Nov 2005 17:42:38 GMT
Expires: now
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Server: JRun Web Server
*************************************
*************************************
And here is the one its not working on:
GET /?handler=/system/login/ok&login=craig.freyman@medpt.com&password=&next=/freyman/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: performance.telept.com
Connection: Keep-Alive
HTTP/1.0 302 Moved Temporarily
Date: Tue, 08 Nov 2005 17:39:46 GMT
Expires: now
Server: JRun Web Server
Set-Cookie: BREEZESESSION=breezqokc2obd9asbydrd;path=/
Content-Length: 0
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Location: http://conference2.telept.com/freyman/
GET /freyman/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: conference2.telept.com
Connection: Keep-Alive
HTTP/1.1 200 OK
Date: Tue, 08 Nov 2005 17:39:46 GMT
Expires: now
Content-Type: text/html; charset=UTF-8
Set-Cookie: BREEZESESSION=breez6eex8c9bwko4qtsc;path=/
Transfer-Encoding: chunked
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Server: JRun Web Server
The second GET made by the client in the first example refers to a cookie and in the second example it does not. Could this be the reason I have to login twice? - JRahm
Admin
The second query is missing the cookie, any reason why? What is different about the second query (concerning the BigIP)? - Craig_Freyman_1
Nimbostratus
The only thing different about the second query is I am applying that IRULE to it that replaces the HOST. The first query goes to conference2.telept.com the second goes to performance.telept.com which is supposed to be bounced over to conference2.telept.com.
Is there some rule that will retain the cookie info when the HTTP Host header is changed? - unRuleY_95363Historic F5 AccountI think your problem might be that the Location header contains the un-changed host name, yet the BREEZESESSION cookie is under the other domain. There are a couple of things you could do to test this out. One would be to update cookie to use a broader domain. Another approach would be to make sure the Location header points to the right host.
- Craig_Freyman_1
Nimbostratus
I'm trying to do determine if there is a cookie, if there is, to change the location. This doesnt work though:
when HTTP_REQUEST {
set foundcookie 0
HTTP::header replace Host conference2.telept.com
if {([HTTP::cookie exists])} {
set foundcookie 1
}
}
when HTTP_RESPONSE {
if {$foundcookie == 1} {
HTTP::header replace Location http://performance.telept.com/freyman/
}
}
I receive
01070151:3: Rule [mask-URL] error:
line 4: [wrong args] [HTTP::cookie exists] - You are missing the cookie name in the HTTP::cookie exists command.HTTP::cookie exists - Returns a true value if the cookie exists.
when HTTP_REQUEST { set foundcookie 0 HTTP::header replace Host conference2.telept.com if { [HTTP::cookie exists "enter_name_of_cookie_here"] } { set foundcookie 1 } } when HTTP_RESPONSE { if {$foundcookie == 1} { HTTP::header replace Location http://performance.telept.com/freyman/ } }
-Joe - unRuleY_95363Historic F5 AccountYou'd be better off looking for a 302 response status code and replacing the Location header then. The location header is only used on redirects and is not directly related to the cookie.
The other option would be to check if the cookie exists in the response and update it to have a domain of performance.telept.com.
You should try updating the location header first though. - Craig_Freyman_1
Nimbostratus
Still not working right, whent he redirect happens one of the cookies gets lost. Is there a way to use the "cookie persistence profile?" - unRuleY_95363Historic F5 AccountI don't think adding cookie persistence is going to help you as that adds another cookie used to persist to a backend server.
Perhaps you should try always updating the cookie in the response to have a broader domain. Also, you could check on the client to see where the cookie (under what domain) the cookie was saved. - Craig_Freyman_1
Nimbostratus
Like this?
when HTTP_REQUEST {
HTTP::header replace Host conference2.telept.com
if {[HTTP::cookie exists BreezeLoginCookie]} {
HTTP::cookie domain .telept.com
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
