NGINX config multi site Image are not displaying on Sub domains

Alex Kolobok lists at
Mon Nov 29 11:56:52 MSK 2010

I don't know is the is anybody who can help me I need an expert advice
or somebody who encountered this problem. Here is a problem can't figer
out what is the problem with my set up.


Images on sub domains are not displaying properly the main domain images
are working.
I don't know if the is an options in wp I am not awere of or it is my
Below are my nginx config


server_name *;
listen 80;
#on server block
##necessary if using a multi-site plugin
server_name_in_redirect off;
##necessary if running Nginx behind a reverse-proxy
port_in_redirect off;
access_log /var/log/nginx/localhost.access.log;

location / {
root /var/www/mysite;
index index.html index.htm index.php;
# if the requested file exists, return it immediately
if (-f $request_filename) {

set $totalcache_file '';
set $totalcache_uri $request_uri;

if ($request_method = POST) {
set $totalcache_uri '';

# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
set $totalcache_uri '';

if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
set $totalcache_uri '';

# if we haven't bypassed the cache, specify our totalcache file
if ($totalcache_uri ~ ^(.+)$) {
set $totalcache_file /wp-content/w3tc-$http_host/pgcache/$1/_index.html;

# only rewrite to the totalcache file if it actually exists
if (-f $document_root$totalcache_file) {
rewrite ^(.*)$ $totalcache_file break;

##W3 Total CACHE END
# all other requests go to WordPress
if (!-e $request_filename) {
rewrite . /index.php last;

## Images and static content is treated different
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
root /var/www/mysite;

location ~ .php$ {
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/mysite$fastcgi_script_name;

Everything else is default
Links to images are as follows
and blogs.dir folder

I think the is a error in my

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
root /var/www/mysite;

If anybody have a solution it will be really appreciated.

Posted via

More information about the nginx mailing list