Forum Discussion
Redirect iRule for http TimeStamp service
Hi fellows, I have spent couple of days struggling to redirect Time-Stamp service to different port. Basically it's a normal http connection based service.
I Wrote an iRule:
when HTTP_REQUEST
{
if {([HTTP::path] contains "tsa") and ([HTTP::host] contains "8080") }{
HTTP::redirect "http://10.132.24.96:8040[HTTP::uri]"
}
}
It works in a browser but not as a TimeStamp service...
Funny thing is that when I'm accesing it with addres http://10.132.24.96:8040[HTTP::uri] it works fine, but not when I use http://10.132.24.96:8080[HTTP::uri] - the redirected one is not working and I've no idea why...
I Hope I can count on Your advise on this topic. Up-front thanks to anyone who can help.
Ok, so I've changed redirect to HTTP::respond 307 Location as redirect can't pass POST.
Everything works fine now :)
Thanks for advice on -L switch in curl @Jad.
- Pawel_G_306732Altostratus
For more info:
- Vijay_ECirrus
Your iRule looks good. Maybe you can make it a bit more specific by matching on ":8080" instead of just "8080".
1.Check to see if there are any errors in the logs.
2.Can you run a curl command to see what kind of redirect or response you are getting ? This will help identify the issue.
- Vijay_ECirrus
Based on the CURL output (Location Header), the redirect seems to be working.
- Stanislas_Piro2Cumulonimbus
Hi,
if you want to check port, you can use this irule :
when HTTP_REQUEST { if {([HTTP::path] contains "tsa") and ([TCP::local_port] equals "8080") }{ HTTP::redirect "http://10.132.24.96:8040[HTTP::uri]" } }
- Stanislas_Piro2Cumulonimbus
the timestamp service may not include port in the Host Header.
- Pawel_G_306732Altostratus
Ok, so I've changed redirect to HTTP::respond 307 Location as redirect can't pass POST.
Everything works fine now :)
Thanks for advice on -L switch in curl @Jad.
Recent Discussions
Related Content
* 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