0

I want serve static files with nginx.

User will request like this format:

http://test.com/files/ea624cf923ea

Actual file location will like this

/files/ea/62/4c/f923ea

How can I serve this file?

I'm stuck with this:

How to split request_uri and send reformatted request_uri or some variable to try_files

1 Answer 1

0

This should work

location /files/ {
    rewrite "^(/files/..)(..)(..)(.{6})$" $1/$2/$3/$4 break;
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .