Is there any way for Nginx to do 'slugification' of an incoming URL?
For example:
https://example.com/oldstuff/This%20Was%20An%20Actual%20App
to
https://example.com/newsite/this_was_an_actual_app
I mean, I can do it with a big URL rewrite table, but I'd like it if Nginx can just do the slugification.
The other alternative would be to modify our app to take the 'oldstuff' URL and do the slugification internally, and do the redirect, but we don't have access to all of the new app's source code.
I've spent some time binging (actually, Startpage), but haven't found an Nginx or regex pattern to do this slugification conversion. It's not just replacing %20's with _, its the conversion to all lower case. Hmm ... maybe that's the way to do it, but I think that'll be a really hairy RegEx.
I didn't see 'to lower' or anything like it here, much less slugification: Guide on how to use regex in Nginx location block section? although it's a great guide nevertheless.