2015-04-04 35 views
0

我有關於代理的問題。lighttpd反向代理| http:// xxx:port - > http://xxx/catalog/index.html

我已經在xxx:port(它來自運動樹莓派的實時流)上獲得內容。我想公開它,但動議現在不提供任何auth方法(在以前的版本中,但沒有ATM ...)我想重定向到http://xxx:port的流量到我的安全目錄樹莓上http://xxx/catalog/index.html

我沒有經驗lighttpd,我試圖搜索這裏和谷歌的例子,但這些例子與網站< - >網站代理,而不是端口 - >目錄。

預先感謝您:) MacieX

回答

0

這聽起來像是你只是尋找一個簡單的重定向。

在你的lighttpd.conf中啓用mod_redirect。

server.modules = (
    . 
    "mod_redirect", ## uncomment or add this line 
    "mod_rewrite", 
    . 
    . 
    . 
) 

,然後添加以下到文件末尾...

$SERVER["socket"] == ":8080" { 
    url.redirect = (
     ".*" => "http://example.com/catalog/index.html" 
    ) 
} 

這將請求重定向到8080端口到目錄。