Handle regular expression routing targets
Handle regular expression routing targets, such as listing, add, delete or update.
Note that to match towards HTTP method, use 'Method'. And to match towards URI, use 'RequestURI'. For headers, just use
the header key such as 'User-Agent'.
When several regular expressions are defined, the first matching will be used for routing.
Examples:
regexproutes list
regexproutes -f id=1
regexproutes -f name="MyRegExpRoute*"
regexproutes add myRegExpRoute --reject --regexp=User-Agent:".*curl.*"
regexproutes add myRegExpRoute --regexp='User-Agent:".*curl.*":1'
regexproutes add myRegExpRoute --regexp=RequestURI:"\".*/images/.*\"":2
regexproutes add myRegExpRoute --regexp='Method:"GET":1~2,RequestURI:"/test/*":1~3 --subdecision=weight (~<number represents weight(optional))
regexproutes add myRegExpRoute --regexp-csv=my_regexps.csv
regexproutes update 1 --name newname
regexproutes delete 1
regexproutes inspect 1
CSV:
Note: For reject, only Header,RegExp is required.
Fields(csv line):
Header,RegExp,Tag ID,weight(optional)
Example:
RequestURI,".*/images/.*",1,1
RequestURI,".*prod\"test\".*",2,2
RequestURI,"/live/.*",1
Weights:
Represented by <Tag ID>~<weight>. Can be used to set priority between tags on the same RegExp-match.
For example: --regexp=RequestURI:"/images/.*":1~1,RequestURI:".*/images/.*":2~2 - Will give nodes with tag ID: 2
higher priority than tag ID: 1 for clients within RegExp match: "/images/.*" because the weight: 2 is higher.
-h, --help help for regexproutes
-c, --config string configuration file for the CLI (default ~/.vcli.yml)
Could also be set via VARNISH_CONTROLLER_CLI_CONFIG=/path/to/config.yml
--csv Output the response table as CSV format.
-j, --json Output the response table as JSON format.