• Resolved kolobok

    (@kolobok)


    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.

    Problem@@@_______________________________________________________________

    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 setup
    ___________________________________________________________________________
    Below are my nginx config

    RUNNING NGINX+FASTCGI ON DEBIAN.
    _

    server{
    server_name *.mysite.com mysite.com https://www.mysite.com;
    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) {
    break;
    }

    ## W3 Total CACHE BEGIN
    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_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/mysite$fastcgi_script_name;
    }
    }
    ___________________________________________________________________

    Everything else is default https://subdomain.main.com/files/2010/11/5537445.jpg
    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.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘NGINX config multi site Image are not displaying on Sub domains’ is closed to new replies.