Hoping that someone can shed a little light on my problem. I have Nginx and WordPress multisite working well enough. When I map a domain to one of my sites everything seems fine until I attach media. The preview for the image isnt there. If i got and edit the image I can see and edit it. If I follow the image's link it returns a Wordpress provided 404 page. I am a noob and have been over my nginx settings and read everything I could but still cant see why this is happening. Kinda hoping someone can point out my mistakes. and shed some light upon the dark place Ive been all day.
map $uri $blogname{
~^(?P/[^/]+/)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 ;
}
You may add here your
server {
root /var/www;
index index.php index.html index.htm;
server_name example.com www.example.com;
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/wp-content/blogs.dir ;
access_log off; log_not_found off; expires max;
}
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}
location / {
try_files $uri $uri/ /index.php?$args ;
}
#add some rules for static content expiry-headers here
location ~ .*\.(php|php5)?$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
client_max_body_size 8M;
}