Forum Discussion
Justin_Vo_48203
Nimbostratus
Jun 25, 2008redirect irule and log error
Hi,
I have a redirect iRule for http to https. It has been working for a while but now it doesn't redirect the browser. A packet capture indicate the virtual server return the redirection code 302 but then reset the connection straight away hence the browser display page can't be display. In the ltm log I get this message
Jun 21 03:46:09 tmm tmm[929]: 01220001:3: TCL error: Rule RedirectHTTP-to-HTTPS - Error: invalid log priority: (line 2) invoked from within "log local0. "redirect to https://[getfield [HTTP::host] ":" 1][HTTP::uri]""
This is my iRule
rule RedirectHTTP-to-HTTPS {
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
log local0. "redirect to https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
}
}
Is this a fault on the F5 or something I have done wrong, my version is 9.3.1 HF1 ? What I have is a virtual server with listen on http with this irule as the resource and another virtual server for HTTPS.
Thanks
Justin Vo
3 Replies
Sort By
- Hamish
Cirrocumulus
Either fix your log line to include a priority (i.e. facility.priority vs facility.) or comment it out. The fault is in your iRule missing the facility on the log statement. - Colin_Walker_12Historic F5 AccountThis looks like an issue with quotes. Make sure to escape all the quotes in the line you want logged with a \, otherwise they're going to terminate your log line.
log local0. "redirect to https://[getfield [HTTP::host] \":\" 1][HTTP::uri]"
- Justin_Vo_48203
Nimbostratus
Thank you both for your reply. Just add to this, when I did a reload of the configuration by "b load", the problem seem to disappear. Any explanation to this ?
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