Unusual characters not loaded in Boost static cache

Events happening in the community are now at Drupal community events on www.drupal.org.
Rockland Steel's picture

(Setup: Drupal 6.20, Boost 1.18, Nginx 0.7.67)

When the URL of the boosted node contain character or 中国新闻网新闻中心, the cached node is correctly cached in the cache directory, and correctly reflecting the URL.

But when accessing the node, the uncached node loaded instead.

Below is the Nginx rules I use:

server {
    server_name *.com *.net *.org;
    location / {
        root   /var/www/html/$host;
        index  index.php;
        set $boost "";
        set $boost_query "_";
        if ( $request_method = GET ) {
          set $boost G;
        }
        if ($http_cookie !~ "DRUPAL_UID") {
          set $boost "${boost}D";
        }
        if ($query_string = "") {
          set $boost "${boost}Q";
        }  
        if ( -f $document_root/cache/normal/$host$request_uri$boost_query.html ) {
          set $boost "${boost}F";
        }
        if ($boost = GDQF){
          rewrite ^.*$ /cache/normal/$host/$request_uri$boost_query.html break;
        } 
        if (!-e $request_filename) {
          rewrite  ^/(.*)$  /index.php?q=$1  last;
          break;
        }
    }
    location ~ \.php$ {
            fastcgi_pass    127.0.0.1:9000;
            fastcgi_index   index.php;
            fastcgi_param   SCRIPT_FILENAME /var/www/html/$host$fastcgi_script_name;
            include         fastcgi_params;
    }
}

I've tried adding charset utf-8; under http { and under server {. Both of them not works.

Since cached node is correctly created in the cache directory, so this is not Drupal or Boost problem, but the problem is how to make Nginx read that cached file.

Comments

Your configuration

perusio's picture

has several stylistic issues that have a performance counterpart.

  1. You're not using try_files. Instead you're using a mod_rewrite like approach with the file check.

  2. I'm not a Boost expert, but I believe that you should instead of using $request_uri which includes the query string and
    arguments, use $uri_$args.html.

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week