Welcome! Log In Create A New Profile

Advanced

Caching Problem

JG
December 21, 2010 06:58AM
Hello,

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 127.0.0.1;
allow xyz;
deny all;
}



location ~*
\.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$
{
root /srv2/xxx/htdocs;
proxy_cache ccdscache;
proxy_cache_valid 200 1m;
proxy_cache_key backend$request_uri;
proxy_cache_use_stale error timeout
invalid_header;

}

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

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_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/srv2/xxx/htdocs$fastcgi_script_name;
include /etc/nginx/fastcgi_params;

}
}

any ideas whats wrong here?

Thanks!



_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Caching Problem

JG December 21, 2010 06:58AM

Re: Caching Problem

Piotr Sikora December 21, 2010 07:02AM

Re: Caching Problem

JG December 21, 2010 07:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready