2010-05-26 37 views
11

我想配置nginx的(0.7.65),所以它會代理服務器A,如果它得到404將嘗試代理服務器B.ngnix到代理服務器B僅當上了車服務器404

我試過以下,但它不工作。有任何想法嗎?

server { 
    error_log /tmp/nginx.error.log; 
    access_log /tmp/nginx.access.log; 
    listen 4433; 
    server_name localhost; 

    location/{ 
     proxy_pass http://localhost:5984; 
     error_page 404 = @fallback; 
    } 

    location @fallback { 
     proxy_pass http://localhost:5983; 
    } 
} 
+0

有誰知道如何與Apache做到這一點? – 2011-07-20 15:42:43

回答

7
proxy_intercept_errors on; 
+0

感謝您的回答。可悲的是,我沒有回憶爲什麼我問這個問題(或檢查它的能力)。 :) – lazy1 2011-07-21 16:38:25