Commits

Ales Zoulek committed 861a91e

cache on disk

  • Participants
  • Parent commits e339143

Comments (0)

Files changed (1)

File conf/nginx/ng_proxy_test.conf

 	server localhost:10002;
 }
 
+proxy_temp_path   /var/cache/nginx/tmp;
+proxy_cache_path  /var/cache/nginx levels=1:2 keys_zone=ng_proxy_test_master_cache:8m max_size=100m inactive=100m;
+
 server {
 	listen 80;
 	server_name location;
 
 	location @ng_proxy_test_master_fallback{
 		proxy_pass http://ng_proxy_test_master;
+
+		# cache on disk
+		proxy_cache ng_proxy_test_master_cache;
+		proxy_cache_valid  200 302  20s;
+		proxy_cache_valid  404      10s;
+
+	}
+	location @ng_proxy_test_comments_fallback{
+		proxy_pass http://ng_proxy_test_comments;
 	}
 	location / {
-		set $redis_key $uri;
-		redis_pass localhost:6379;
-		default_type   text/html;
-		error_page     404 = @ng_proxy_test_master_fallback;
 	}
 	location /ssi/comments/ {
-		proxy_pass http://ng_proxy_test_comments;
+		set            $redis_key $uri;
+		redis_pass     localhost:6379;
+		default_type   text/html;
+		error_page     404 = @ng_proxy_test_comments_fallback;
 	}
 }