I am very new to nginx but i have been tasked with doing some rewrite rules to cover a new URI structure as part of a website migration. I have browsed this site and i see that there is a solution that I'm not sure will work for us.
Basically i take a URL like abc.com/l/hello+there and replace it with abc.com/address/hello-there
So the replacement of the "/l/" to "/address" is easy, but the replacement of the "+" to "-" seems very tricky as I cant seem to manipulate the variable $2, where it sits.
Has anyone any suggestions ? It was suggested that i just redirect it to a javascript back end as it would be much easier to handle there. If there was a solution where the "+" to "-" replacement could happen in the server block, and then passed to the location block for the processing of the "/l/" to "/address".
Any suggestions would be greatly accepted.