Proxy store не работает
Berezovsky Pavel
nginx-forum на nginx.us
Ср Окт 20 12:16:34 MSD 2010
Здравствуйте.
Нужна помощь. Не могу заставить nginx 0.8.52
кэшировать ответы backend сервера. При
этом на версии 0.7.65 все работает.
/usr/local/nginx/sbin/nginx -V
nginx version: nginx/0.8.52
built by gcc 4.3.2 (Debian 4.3.2-1.1)
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid
--lock-path=/var/lock/nginx.lock
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
--with-http_stub_status_module --with-http_flv_module
--with-http_ssl_module --with-http_dav_module
--with-http_gzip_static_module --with-http_realip_module --with-mail
--with-mail_ssl_module
Часть nginx.conf
user www-data;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
worker_rlimit_nofile 10240;
events {
worker_connections 1000;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
#access_log off;
# PROXY CACHE #
proxy_cache_path /var/lib/nginx/proxy levels=1:2
keys_zone=my_cache:10m max_size=1024m inactive=4d;
proxy_temp_path /var/lib/nginx/proxy_temp 1 2;
# proxy_cache_min_uses 1;
proxy_cache_valid 200 1m;
# proxy_cache_valid 304 302 1m;
proxy_cache_valid 404 1m;
proxy_cache_use_stale error timeout invalid_header http_500
http_502 http_503 http_504;
proxy_pass_header Cookie;
proxy_pass_header Set-Cookie;
# proxy_buffering on;
# proxy_store on;
#####################################
#GZIP#
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain application/xml application/x-javascript
text/css;
output_buffers 1 32k;
sendfile on;
#tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
## PROXY ####
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 16k;
proxy_buffers 8 16k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 10m;
proxy_ignore_client_abort on;
server {
}
...
server {
listen 81;
server_name www.example.com;
server_name_in_redirect off;
access_log /var/log/nginx/access.log main;
#access_log off;
error_log /var/log/nginx/debug.log debug_core;
location / {
proxy_pass http://127.0.0.1:8088;
proxy_cache my_cache;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_key
"$scheme$request_method$proxy_host$uri$is_args$args$cookie_member_id";
proxy_ignore_headers "Cache-Control" "Expires";
proxy_hide_header "Set-Cookie";
proxy_cache_bypass $cookie_member_id;
proxy_no_cache $cookie_member_id;
}
.....
}
При этом в логах
2010/10/20 08:00:00 [crit] 28112#0: *11467 rename()
"/var/lib/nginx/proxy_temp/9/26/0000000269" to "/usr/local/nginx/html/"
failed (20: Not a directory) while reading upstream, client:
aa.xx.yy.zz, server: www.example.com, request: "GET / HTTP/1.1",
upstream: "http://127.0.0.1:8088/", host: " www.example.com", referrer:
"..."
Директория /var/lib/nginx/proxy пустая. Откуда
взялось /usr/local/nginx/html/ если указывал
/var/lib/nginx/proxy
Права на директории - правильные.
Posted at Nginx Forum: http://forum.nginx.org/read.php?21,142596,142596#msg-142596
Подробная информация о списке рассылки nginx-ru