Forum Discussion
skarpovi_111573
Nimbostratus
Apr 09, 2008HTTP::header insert
tried to use simple rule with HTTP::header insert, but don't see anything in TCP dump. it does redirect to https, however - no string in the header
when HTTP_REQUEST {
if {[TCP::local_port] eq "80"} {
HTTP::header insert STRING "MLint"
HTTP::redirect "https://[HTTP::host][HTTP::uri]test"
} elseif {[TCP::local_port] eq "80" } {
HTTP::redirect "http://[HTTP::host][HTTP::uri]"
} else {
pool test-Servers-Pool
}
}13 Replies
- skarpovi_111573
Nimbostratus
thanks for respond. still can't make it to work.
Here is the rule that i use:when HTTP_REQUEST { if {([TCP::local_port] eq "80") and ([IP::addr [IP::client_addr]/16 equals 10.0.0.0])} { HTTP::respond 302 Location "https://[HTTP::host][HTTP::uri]" Set-Cookie "my_cookie=MLInt\; Path=/test\; Domain=10.110.2.2\;" } elseif {[TCP::local_port] eq "80" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } else { pool eRoom-Servers-Pool } }
and here is what i see as a respond from BigIP. Nothing in the Cookie. what i'm doing wrong?HTTP/1.0 302 Found Location: https://10.110.2.2/eroom Server: BIG-IP Connection: Keep-Alive Content-Length: 0 - hoolio
Cirrostratus
Can you try just this?
HTTP::respond 302 Location "https://[HTTP::host][HTTP::uri]" Set-Cookie "my_cookie=my_value"
Here is a simplified example which I've used in a customer rule:
Send a redirect and expire the session cookie
HTTP::respond 302 Location https://[HTTP::host]/some/path/ Set-Cookie "session_cookie_name=null\;Expires=Thurs, 01-Jan-1970 00:00:00 GMT"
Aaron - skarpovi_111573
Nimbostratus
thanks for your help. looka like i got it to work.
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
