Created
November 10, 2022 18:24
-
-
Save broland07/1ebc37685ee0e8d97530df6d4014efaa to your computer and use it in GitHub Desktop.
nginx location block with regex if you want create subdirectories with the first letter from the file name.(It not contains accent characters.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^(/images/)([A-Za-z0-9_\-!~$.])([A-Za-z0-9_\-!~$.]*\.[A-Za-z0-9_\-!~$.]+)$ { | |
try_files $uri $1$2/$2$3 =404; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment