Mitesh Shah 12 years ago
parent
commit
7f1ab145cd
  1. 16
      conf/nginx/multisite/subdir/basic.conf

16
conf/nginx/multisite/subdir/basic.conf

@ -1,13 +1,15 @@
map $uri $blogname{
~^(?<blogpath>/[^/]+/)files/(.*) $blogpath;
~^(?<blogpath>/[^/]+/)files/(.*) $blogpath;
}
map $blogname $blogid{
default "";
default -999;
#Add list of blogs with their ids. SEE "FILE-HANDLING" SECTION.
#/site1/ 2;
#/site2/ 3;
# Must Read - http://rtcamp.com/tutorials/nginx-maps-wordpress-multisite-static-files-handling/
# example.com/site1/ 2;
# example.com/site2/ 3;
include /var/www/example.com/htdocs/wp-content/plugins/nginx-helper/map.conf;
}
server {
@ -19,8 +21,8 @@ server {
root /var/www/example.com/htdocs;
index index.php;
location ~ ^(/[^/]+/)?files/(.+) {
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2;
location ~ ^(/[^/]+/)?files/(?<rt_file>.+) {
try_files /wp-content/blogs.dir/$blogid/files/$rt_file /wp-includes/ms-files.php?file=$rt_file;
access_log off; log_not_found off; expires max;
}

Loading…
Cancel
Save