Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Проблема с кэшем
- To: nginx-ru@xxxxxxxxx
- Subject: Проблема с кэшем
- From: Игорь Вавржин <igor.vavrjin@xxxxxxxxx>
- Date: Fri, 19 Aug 2011 18:26:29 +0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=u1NhtDmVRipPgEjUTIYwIAVDj/hrMgKS3TuPBKTzzc8=; b=O0Dk2/epqH1aEKjeCfeUWOZfNpsP0Jm2cEVtn5/ao4Xx9NHKJb/DKa4cc8HOgMTUZ4 Hr/dIHt8pmlYm8/ld/7ftWEUnJzckbVm7DsaNkRvX7JG50QfkXaoUZHTh1wcXDLeSTSx OK6hWZNyioRx5J8Ka76l5oWFbEKoUgf26GGI4=
Здравствуйте.
Периодически появляется такая проблема: в кэш nginx попадает примерно
вот такое содержимое
KEY: nsk|GET|site.com|/page.html
X-Powered-By: PHP/5.3.6-6~dotdeb.0
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Fri, 19 Aug 2011 10:32:20 GMT
Content-Type: text/html; charset=UTF-8
Соответственно при попытке обратиться повторно за ответом - браузер
ничего в ответ не получает (нет вообще контента) и говорит что адрес
недоступен.
Спасает чистка кэша. Скажите что можно сделать, а то я в панике :)?
Конфиг nginx:
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_requests 5;
keepalive_timeout 15;
types_hash_max_size 2048;
client_max_body_size 20m;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;
##
# file cache
##
open_file_cache max=10000 inactive=10m;
open_file_cache_valid 2m;
open_file_cache_min_uses 2;
open_file_cache_errors on;
##
# Virtual Host Configs
##
fastcgi_cache_path /var/cache/nginx levels=1:2
keys_zone=getpages:50m max_size=500m;
upstream backend_local {
server unix:/var/lib/php5/php5-fpm.sock;
}
include /etc/nginx/sites-enabled/*;
}
sites-enabled/default.conf
server {
listen *:80 default;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
charset utf-8;
root /var/www/data;
location / {
index index.php;
set $path_info $uri;
try_files $uri $uri/ /index.php?$args;
}
if ($request_method != "GET") {
set $not_cached 1;
}
location ~ \.php$ {
fastcgi_pass backend_local;
include fastcgi_params;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SERVER_NAME $host;
fastcgi_cache_bypass $is_args $not_cached $cookie_PHPSESSID
$cookie_no_nginx_cache;
fastcgi_no_cache $is_args $not_cached $cookie_PHPSESSID
$cookie_no_nginx_cache;
fastcgi_cache getpages;
fastcgi_cache_valid 200 301 302 304 15m;
fastcgi_cache_key
"$cookie_city_code|$request_method|$host|$request_uri";
fastcgi_ignore_headers "Cache-Control" "Expires";
}
}
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|