Last active
August 29, 2015 14:02
-
-
Save zamoose/350674aed5c01ba9072c to your computer and use it in GitHub Desktop.
This file contains 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
map $uri $blogname{ | |
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ; | |
} | |
map $blogname $blogid{ | |
default -999; | |
#Ref: http://wordpress.org/extend/plugins/nginx-helper/ | |
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ; | |
} | |
[...] | |
location ~ ^(/[^/]+/)?files/(.+) { | |
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ; | |
access_log off; | |
log_not_found off; | |
expires max; | |
} | |
#avoid php readfile() | |
location ^~ /blogs.dir { | |
internal; | |
alias /var/www/example.com/htdocs/wp-content/blogs.dir ; | |
access_log off; | |
log_not_found off; | |
expires max; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment