I’ve a quick question, that would solve me some problems if possible:
Is it possible to split / manipulate the request-url with nginx?
What I mean is: an url like this: sub.somewhere.com/something/somethingelse
Is turned into:
subsomethingsomethingelse
And then further into:
sub/som/eth/ing/som/eth/ing/els/e
And then the given path is used to retrieve a File (so probably, it has to be stored in a variable that can be re-used, or used directly)
Is this possible somehow? Or if not, what exactly would be possible, and where are the limitations?
(edit) Are there native possibilities to do this, whitout including the PERL Module? Or is that the only way? (maybe a smaller module that only does string handling? )
it is possible and relatively easy, all you need to do is match your location on a regexp with the approriate back references
you need to save the backreferences before the rewrite because the rewrite directive resets the references to those in the regexp first argument (so if you use some other directive like try_files that doesn’t do that you coul just use the backreferences directly without saving them)