Hello,
I want to rewrite Uri to match against entries from a mapping file. How can I use rewrite_by_lua to match the entry from the file?
Example: my mapping file customer_rewrite.conf includes following entries.
/customers/accounts/[A-Za-z0-9_.-~%]+/credit-cards /customers-credit-cards;
/customers/[A-Za-z0-9_.-~%]+/debit-cards /customers-debit-cards;
NOTE: For simplicity, I have added only two, but the actual file contains around 30 entries and we have multiple files for each root level. e.g /customers, /tools etc.
I am open to any suggestion for file format. e.g lua table, json etc..
Expected results:
/customers/accounts/1234/credit-cards should be rewriten as /customers-credit-cards/accounts/1234/credit-cards
/customers/34567/debit-cards should be rewriten as /customers-debit-cards/34567/debit-cards
Thanks in advance.