1. Ales Zoulek
  2. ng_proxy_test

Commits

Ales Zoulek  committed 0b98d96

nginx config works on django and redis failures

  • Participants
  • Parent commits e0c5249
  • Branches master

Comments (0)

Files changed (1)

File conf/nginx/ng_proxy_test.conf

View file
  • Ignore whitespace
 
 upstream ng_proxy_test_comments {
 	server localhost:10002;
+	server localhost:10000 backup;
 }
 
-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;
+	server_name localhost;
 	ssi on;
+	root /tmp/;
 
-	location @ng_proxy_test_master_fallback{
-		proxy_pass http://ng_proxy_test_master;
-	}
-	location @ng_proxy_test_comments_fallback{
+	location @ng_proxy_test_comments_django{
+		internal;
 		proxy_pass http://ng_proxy_test_comments;
 	}
+	location @ng_proxy_test_master_django{
+		internal;
+		proxy_pass http://ng_proxy_test_master;
+	}
 
 	location / {
-		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;
+		set            $redis_key $uri;
+		redis_pass     localhost:6379;
+		default_type   text/html;
+		error_page     404 = @ng_proxy_test_master_django;
+		error_page     502 = @ng_proxy_test_master_django;
+
 	}
-	location /ssi/comments/ {
+	location /ssi/ {
 		set            $redis_key $uri;
 		redis_pass     localhost:6379;
 		default_type   text/html;
-		error_page     404 = @ng_proxy_test_comments_fallback;
+		error_page     404 = @ng_proxy_test_comments_django;
+		error_page     502 = @ng_proxy_test_comments_django;
 	}
+	
 }
+
+server {
+	server_name localhost;
+	listen 10000;
+	root /home/ales/ng_proxy_test/src/ng_proxy_test/static/errors/;
+
+	location /ssi/comments/ {
+		error_page 404 =200 /comments.html;
+	}
+}
+