Appendix C: Scripts : Examples
This section provides example scripts for popular use cases. It includes the following examples:
“Select content routes based on URI string matches”
“Rewrite the HTTP request host header and path”
“Rewrite the HTTP response Location header”
“Redirect HTTP to HTTPS using Lua string substitution”
“Redirect mobile users to the mobile version of a website”
Tip: The examples show debug strings. Debug strings can be written to the console when the event is triggered. This is helpful when you are testing your scripts.
To enable debug strings to be written to the console, use the following CLI commands:
diagnose debug enable
diagnose debug application haproxy scripting