Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Sep 25, 2010 2:33 am 
Offline
Senior Member

Joined: Sat Sep 25, 2010 2:25 am
Posts: 75
Website: http://www.ruchirablog.com
Location: Sri Lanka
Hello,
I have nginx+memcached+wp supercache running on my blog!

How ever I performed non www to www redirect in /usr/local/nginx/conf/nginx.conf

And I have inserted wp supercache code inside to this (red color) and its working properly!

How ever after adding www redirect and restarting nginx it shows this error. It seems like error is on wp supercache code but it works properly. And non www redirect is not working as it should

Image

Here is my nginx.conf file!

Code:
server
        {
        listen       80;
                server_name www.ruchirablog.com ruchirablog.com;
                 rewrite ^(.*) http://www.ruchirablog.com$1 permanent;
   }

                index index.html index.htm index.php;
                root  /home/wwwroot;

               location / {
# enable search for precompressed files ending in .gz
# nginx needs to be complied using .-with-http_gzip_static_module
# for this to work, comment out if using nginx from aptitude


# if the requested file exists, return it immediately
if (-f $request_filename) {
break;
}

set $supercache_file '';
set $supercache_uri $request_uri;

if ($request_method = POST) {
set $supercache_uri '';
}

# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
set $supercache_uri '';
}

if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
set $supercache_uri '';
}

# if we haven't bypassed the cache, specify our supercache file
if ($supercache_uri ~ ^(.+)$) {
set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
}

# only rewrite to the supercache file if it actually exists
if (-f $document_root$supercache_file) {
rewrite ^(.*)$ $supercache_file break;
}

# all other requests go to Wordpress
if (!-e $request_filename) {
rewrite . /index.php last;
}
}

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }
       location / {
        if (!-e $request_filename) {
            rewrite ^.*$ /index.php last;
         }
        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /home/wwwroot/logs/access.log  access;
    }
include vhost/*.conf;
}



After I restart the nginx it shows the error that pictured above!
Please help me to resolve this as my current non www to www redirect is not working!
Thanks


Top
   
 Post subject:
PostPosted: Sat Sep 25, 2010 3:07 am 
Offline
Senior Member

Joined: Sat Sep 25, 2010 2:25 am
Posts: 75
Website: http://www.ruchirablog.com
Location: Sri Lanka
anyway now i got this working! :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group