• think i have a problem. I don’t know where is but i`m looking for solutions.
    I have wordpress+nginx+pagespeed, i moved the folder uploads in root and changed with the name “cache”.
    i used this command in wp-config:
    define( 'UPLOADS', ''.'cache' );
    after this i’ve added a subdomain for my site img.stancristina.com and it redirects to cache folder.
    cache.stancristina.com and stancristina.com/cache are working, but i want that my files to be visible only with cache.stancristina.com, not stancristina.com/cache.
    When i try to make a new article and to upload a file, that file is set primary stancristina.com/cache, not cache.stancristina.com as i wanted.
    What i`m wrong?
    This is my conf:

    server {
    listen 80;
    server_name stancristina.com www.stancristina.com;
         location / {
                    try_files $uri $uri/ =404;
        }
    root /srv/stancristina.com;
     index index.php index.html index.htm;
    
    	if (!-e $request_filename) {
    	rewrite ^(.*)$ /index.php?q=$1 last;
    	rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
    	rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
    	break;
    	}
    
           location ~ \.php$ {
                fastcgi_buffers 8 256k;
                fastcgi_buffer_size 128k;
                fastcgi_intercept_errors off;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
    
            }
    
    	location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
    	location ~ "^/ngx_pagespeed_static/" { }
    	location ~ "^/ngx_pagespeed_beacon$" { }
    	location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
    	location /ngx_pagespeed_global_statistics { allow 127.0.0.1; deny all; }
    	location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }
    	location /pagespeed_console { allow 127.0.0.1; deny all; }
    }
    
    #Sub Domain
    server {
    listen 80;
    server_name cache.stancristina.com;
    autoindex off;
    location / {
    root /srv/stancristina.com/cache;
    }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Redirecting /cache to cache. in nginx is one thing, but this is another:

    When i try to make a new article and to upload a file, that file is set primary stancristina.com/cache, not cache.stancristina.com as i wanted.

    Go into /wp-admin/network/sites.php and click on the edit link for a site.

    Under settings, check the “Upload Url Path”

    What’s that?

    Thread Starter Marius

    (@buzucan)

    it don’t sure if i understand.
    if i`m going on https://stancristina.com/wp-admin/network/sites.php i have an error: You do not have sufficient permissions to access this page.
    And if i go in sites.php file i don’t find upload url path

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Wait a second… Do you actually have a multisite set up?

    Thread Starter Marius

    (@buzucan)

    i don’t know… how can i verify! if a have? ??
    a need only to work the redirect the domain from that subfolder…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘worpdress nginx problem subdomain’ is closed to new replies.