2012-09-03 14 views
0

我使用starman作爲我的webapp。 Apache Web服務器在端口8080上偵聽。 我想重寫一些請求,如'/request'到starman中的這個Apache web服務器。我試圖找到一些下午,但我發現幾個例子來幫助我。如何代理一個starman請求到Apache?

+0

這似乎是錯誤的做法。 Apache代理starman是更常見的情況。 – MkV

回答

1

Plack::App::Proxy允許您代理app.psgi中的另一個Web服務器。從簡介中修改:

use Plack::Builder; 

# proxy all requests for /request to 127.0.0.1:8080 
builder { 
    mount "/request" => Plack::App::Proxy->new(remote => "http://127.0.0.1:8080")->to_app; 
}; 
+0

你是對的。或許在一開始,我認爲是錯誤的。當然,我們可以使用nginx來解決這個問題。反正,TKS〜 – AilesFX