• Hello, since we switched from Apache to Nginx we’re unable to switch between the Dashboards of the different sites in the backend. The Nginx-Helper Plugin is configured and building the Nginx map.conf, which is included in the Nginx Config. There are no caches (WP Supercache, Totalcache, Nnginx Cache, etc.) enabled at the moment. Nginx is running as the primary webserver for the sites.

    When I go to ‘My Sites’ in the WordPress backend and try to switch to a Sub-Sites dashboard, it simply will throw me back to the Main Sites Dashboard, even if the URL/URI changes to http://www.mysite.com/subsite1/wp-admin , http://www.mysite.com/subsite2/wp-admin , etc., it somehow anyways will always display the Dashboard of the Main site.

    WP Plugins enabled:
    Advanced Custom Fields
    CMS Page Order
    Nginx Helper
    Regenerate Thumbnails
    Rename wp-login.php
    TinyMCE Advanced
    WordPress Importer
    Wordpress MU Domain Mapping (Options enabled: 2, 3, 4)

    Nginx Vhost Config:

    $http_host $blogid
    {
        default -999;
        include /var/customers/webs/mydomain.com/wp-content/uploads/nginx-helper/map.conf;
        #Ref: http://wordpress.org/extend/plugins/nginx-helper/
    }
    
    server
    {
        listen 10.0.0.2:80;
        server_name mydomain.com *.mydomain.com;
        root /var/customers/webs/mydomain.com/;
        index index.php;
    
        # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
        location ~ /\. {
                deny all;
        }
    
        # Deny access to any files with a .php extension in the uploads directory
        location ~* /(?:uploads|files)/.*\.php$ {
                deny all;
        }
    
        location / {
                index index.php;
                try_files $uri $uri/ /index.php?$args;
        }
    
        # Directives to send expires headers and turn off 404 error logging.
        location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
               access_log off; log_not_found off; expires max;
        }
    
        # Uploaded files access
        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 ~ ^/[_0-9a-zA-Z-]+/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/customers/webs/mydomain.com/wp-content/blogs.dir;
                access_log off; log_not_found off;      expires max;
        }
    
        # Rewrite multisite '.../wp-.*' and '.../*.php'.
        if (!-e $request_filename) {
                rewrite /wp-admin$ $scheme://$host$uri/ permanent;
                rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
                rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
        }
    
        # Pass all .php files onto a php-fpm/php-fcgi server.
        location ~ \.php$ {
                # Zero-day exploit defense.
                # http://forum.nginx.org/read.php?2,88845,page=3
                # Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
                # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine.  And then cross your fingers that you won't get hacked.
                try_files $uri =404;
    
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    
                # try_files $uri /index.php;
                fastcgi_pass  unix:/var/run/mydomain.com-php-fpm.socket;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
        }
    }

    https://wordpress.org/plugins/nginx-helper/

  • The topic ‘Unable to switch between sites in backend (dashboard, etc.)’ is closed to new replies.