Кеширование nginx для dle?

колбаскин nginx-forum на nginx.us
Вс Май 29 20:54:29 MSD 2011


Пробую настроить связку nginx + apache c
кешированием
Конфиг такой...
Но кеширует только админку, сам сайт не
желает
Отключаю апач и nginx ничего не отдает,
кроме страниц админки где был.
Сижу уже второй день, порванные бубны
мешают ходить по квартире  (
взываю о помощи!

user  www;
pid /var/run/nginx.pid;
worker_processes  8;
worker_priority -5;

events {
    worker_connections  65536;
}

http {

	##
	# Basic Settings
	##
limit_zone  conn_from_one_ip $binary_remote_addr 16m;
limit_req_zone  $binary_remote_addr  zone=lreq:10m   rate=1r/s;
proxy_cache_path /usr/local/etc/nginx/cache levels=1:2 keys_zone=one:16m
inactive=7d max_size=1024m;
proxy_temp_path /usr/local/etc/nginx/temp;

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /usr/local/etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# Logging Settings
	##

	access_log /usr/local/etc/nginx/logs//access.log;
	error_log /usr/local/etc/nginx/logs/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;


client_max_body_size 16m;
log_format  isp '$bytes_sent $request_length';

    include sites/* ;
}

server {
        listen      195.211.151.26:80;
        server_name  satsis.info www.satsis.info satsis.ru www.satsis.ru
satsis.org.ua www.satsis.org.ua 195.211.151.26;

		proxy_temp_path /usr/local/etc/nginx/satsis.info;

		location @nocached {
			proxy_pass http://195.211.151.26:8080;
			proxy_redirect http://satsis.info:8080/ /;
			proxy_set_header Host $host;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Real-IP $remote_addr;
}

		location ~* ^/(catchanell/|/admin.php|online.php) {
			proxy_pass http://195.211.151.26:8080;
			proxy_redirect http://satsis.info:8080/ /;
			proxy_set_header Host $host;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Real-IP $remote_addr;
}		

		location / {
			proxy_pass http://195.211.151.26:8080;
			proxy_redirect http://satsis.info:8080/ /;
        		limit_conn conn_from_one_ip 9;
			proxy_set_header Host $host;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Real-IP $remote_addr;

			#if ($http_cookie ~*
"comment_author_|wordpress_(?!test_cookie)|wp-postpass_") { return 412;
}
			error_page 412 = @nocached;
			proxy_cache one;
			proxy_cache_key "$request_method|$is_args|$host|$request_uri";
			proxy_hide_header "Set-Cookie";
			proxy_ignore_headers "Cache-Control" "Expires";
			proxy_cache_valid 200 302 304 5m;
			proxy_cache_valid 301 1h;
			proxy_cache_valid 503 4s;
			proxy_cache_valid any 1m;
			proxy_cache_use_stale http_502 http_503 http_504;
		}
		location ~*
^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|flv|mp3)$
{
			root /usr/local/www/satsis.info/;
			access_log /usr/local/etc/nginx/logs/satsis.info.access.log;
		}
		location @fallback {
			proxy_pass http://195.211.151.26:8080;
			proxy_set_header Host $host;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Real-IP $remote_addr;
		}
        location /cacti/ {
            alias /usr/local/share/cacti/;
            proxy_pass   http://195.211.151.26:8080;
            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_buffer_size 64k;
            proxy_buffers 64 64k;
        }
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,202009,202009#msg-202009




Подробная информация о списке рассылки nginx-ru