Hacker News new | ask | show | jobs
by zepolen 5819 days ago
Regarding "This logic exists in our rails app, but we didn't want to expose this pathing out to end users". I'm not sure if you understood, but I'm saying exactly this. nginx will take a /whatever request and convert it to /w/wh/wha/whatever on disk transparently - you can (and I have needed to) change this whenever you like with no front facing changes.
1 comments

Oh, that's cool - I didn't know you could use matches from a location in an alias. Is that a new feature in nginx?
I think it's always been a feature of nginx:

    location ~ "/(.*)" {
        root /whatever/$1;
You could even do:

        set $subdir $1;
so that it can be used in another location handler.