Forum Discussion
MABSJ
Nimbostratus
Jan 28, 2020LTM iRule to access F5 file
Hello team, With an iRule is it possible to redirect a URL to a local file within F5 itself? For example, when accessing to the url http://example.com/local/etc/file1 where example.com is ...
cjunior
Nacreous
Jan 28, 2020Hi,
Why don't you do it by creating ifiles and run in a statement?
e.g.
GET http://exmple.com/Common/file1
when HTTP_REQUEST {
if { [catch { set ifileContent [ifile get [HTTP::path]] }] } {
HTTP::respond 404 content "File not found"
} else {
HTTP::respond 200 content $ifileContent
unset ifileContent
}
}
You can also manage that files by command line or iControl.
References:
https://devcentral.f5.com/s/articles/syncing-local-repositories-with-ifiles-1082
https://clouddocs.f5.com/api/irules/iFile.html
Regards.
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