I have Nginx set up as a reverse proxy on my VPS. I also have a WordPress multisite installation set up. Everything works just fine except for the uploaded images. I can create new sites and I can upload images to those site but the images don't display in the backend or on the frontend.
Here is my Nginx config for the multisite installation:
map $http_host $blogid {
default -999;
include /home/cpress/public_html/wp-content/plugins/nginx-helper/map.conf;
}
server {
error_log /var/log/nginx/vhost-error_log warn;
listen 204.197.248.70:80;
server_name churchpr.es www.churchpr.es *.churchpr.es;
access_log /usr/local/apache/domlogs/churchpr.es-bytes_log bytes_log;
access_log /usr/local/apache/domlogs/churchpr.es combined;
root /home/cpress/public_html;
index index.php index.html index.htm;
location / {
location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
expires 30d;
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
error_page 405 = @backend;
add_header X-Cache "HIT from Backend";
proxy_pass http://204.197.248.70:8081;
include proxy.inc;
}
location @backend {
internal;
proxy_pass http://204.197.248.70:8081;
include proxy.inc;
}
location ~ .*\.(php|jsp|cgi|pl|py)?$ {
proxy_pass http://204.197.248.70:8081;
include proxy.inc;
}
location ~ /\.ht {
deny all;
}
location ~ \.php$ {
try_files $uri @wordpress;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://204.197.248.70:8081;
}
location ~ ^/files/(.*)$ {
try_files /wp-content/blogs.dir/$blogid/ $uri/wp-includes/ms-files.php?file=$1;
access_log off; log_not_found off; expires max;
}
location ^~ /blogs.dir {
internal;
alias /home/cpress/public_html/wp-content/blogs.dir;
access_log off; log_not_found off; expires max;
}
}