Blank screen only


#1

I have followed all instructions from http://rtcamp.com/tutorials/wordpress-nginx-fastcgi-cache-purge-conditional/, but all I get is a blank screen. Folders get created within the fastcgi cache path, but no content is displayed and I cannot access the backend either.

Any idea??

Here's my previous working virtual host file:

  
server {  
    listen             XXXXX;  
        server_name        website.com www.website.com;  
        root               /root/to/website;  
        index              index.php;  
   
        location / {  
            try_files $uri $uri/ /index.php?q=$uri&$args;  
        }  
        # Deny access to hidden files  
        location ~* /\.ht {  
            deny            all;  
            access_log      off;  
            log_not_found   off;  
        }  
   
        # Pass PHP scripts on to PHP-FPM  
        location ~* \.php$ {  
            try_files       $uri /index.php;  
            fastcgi_index   index.php;  
            fastcgi_pass    unix:/path/to/php-fpm.sock;  
            include         fastcgi_params;  
            fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;  
            fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;  
        }   
}  

#2

@resende
Can u give me a URL to check?

fastcgi_cache shouldn’t create white screen. If it fails, caching will be skipped.

Also, please check nginx error.log for some hints.


#3

Rahul,

I can give you the URL privately as it’s a development domain, but can assure that only a blank screen is displayed when I use your virtual host file.

I have compiled a different file based on http://www.untwistedvortex.com/setting-up-nginx-fastcgi-cache-wordpress/ and this seems to work, but I’m not sure if it’s totally correct and complete as yours. Here’s what I did:

open_file_cache max=1000 inactive=20s;  
open_file_cache_valid    30s;  
open_file_cache_min_uses 2;  
open_file_cache_errors   on;  
fastcgi_cache_path /path/to/fcgicache levels=1:2 keys_zone=WORDPRESS:10m inactive=60m;  

server {  
    listen             XXXXX;  
        server_name        website.com http://www.website.com;  
        root               /root/to/website;  
        index              index.php;  
   
        location / {  
            try_files $uri $uri/ /index.php?q=$uri&$args;  
        }  
          
        # Deny access to hidden files  
        location ~* /\.ht {  
            deny            all;  
            access_log      off;  
            log_not_found   off;  
        }  

        location ~ /purge(/.*) {  
                fastcgi_cache_purge WORDPRESS $scheme$host$1$request_method;  
                allow 127.0.0.1;  
                deny all;  
        }  
   
        # Pass PHP scripts on to PHP-FPM  
        location ~* \.php$ {  
            try_files       $uri /index.php;  
            fastcgi_index   index.php;  
            fastcgi_pass    unix:/path/to/php-fpm.sock;  
            include         fastcgi_params;  
            fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;  
            fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;  
            set $nocache "";  
            if ($http_cookie ~ (comment_author_.*|wordpress_logged_in.*|wp-postpass_.*)) {  
                    set $nocache "Y";  
            }  
            if ( $request_method ~ ^(HEAD|POST)$ ) {  
                    set $nocache "Y";  
            }  
            fastcgi_no_cache $nocache;  
            fastcgi_cache_bypass $nocache;  
            fastcgi_cache_use_stale error timeout invalid_header http_500;  
            fastcgi_cache_key $scheme$host$request_uri$request_method;  
            fastcgi_cache    WORDPRESS;  
            fastcgi_cache_valid      200 1h;  
            fastcgi_cache_valid      301 1h;  
            fastcgi_cache_valid      302 1h;  
            fastcgi_cache_valid      any 1m;  
        }  
   
}

Maybe a URL rewrite issue with your vhost file? I would like to use your code instead, but need your help to figure out why it’s not working for me.

Let me know. Thanks!


#4

This is really strange as above config is close enough to my config. In fact there is nothing to cause white-screen!

If you want, you can copy some lines from my config to improve your current config:

 #to avoid feed, sitemap from getting cached on a busy site  
 if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {  
                set $no_cache 1;  
        }  

and

  #make use of browser-caching. Highly recommended.  
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;  
        }

Rest, you can use continue with your current config without any issues. :slight_smile:

Just make sure you use a plugin like Nginx-Helper for fastcgi_cache purging. :slight_smile:

Rest, you can send me name of your site privately at rahul@rtcamp.com but that alone will not help. An issue like white-screen will have more details logged in nginx’x error logs.


#5

I am having similar issues.


#6