Caching Problem

Juergen Gotteswinter jg at
Tue Dec 21 14:53:44 MSK 2010


i got a clustered setup, where the content is beeing served from a nfs 
share. thats why i want to cache the static components via nginx, but 
unfortanly i didnt get it to work.

Heres my Config:

Global Configuration nginx.conf section http

     proxy_cache_path  /var/www/cache levels=1:2 keys_zone=ccdscache:32m 
max_size=1000m inactive=7d;
     proxy_temp_path /var/www/cache/tmp;

Vhost Config

server {
         listen       80;
         server_name  xxx;

         location /server_status {

         stub_status on;
         access_log off;
         allow xyz;
         deny all;

         location ~* 
             root /srv2/xxx/htdocs;
                         proxy_cache ccdscache;
                         proxy_cache_valid 200 1m;
                         proxy_cache_key backend$request_uri;
                         proxy_cache_use_stale   error timeout 


         location / {
             root   /srv2/xxx/htdocs;
             index  index.php index.html;
             if (!-e $request_filename) {
                 rewrite  ^/(.*)$  /index.php?q=$1  last;

         error_page  404              /index.php;

#        error_page   500 502 503 504  /50x.html;

         location = /50x.html {
             root   html;

         location ~ \.php$ {
             root   /srv2/xxx/htdocs;
              proxy_cache ccdscache;
              proxy_cache_valid  200 302  60m;
              proxy_cache_valid  404      1m;
               proxy_cache_key         backend$request_uri;
                proxy_cache_valid       200  1h;
                proxy_cache_use_stale   error timeout invalid_header;

             fastcgi_index index.php;
             fastcgi_param  SCRIPT_FILENAME 
            include /etc/nginx/fastcgi_params;


any ideas whats wrong here?


More information about the nginx mailing list