2016-05-09 47 views
0

我是apache2的新手,請原諒任何基本錯誤。我 想一個Debian 8.4傑西服務器 上創建一個Apache的正向代理服務器訪問組織外部的服務器。該 文件地點可用/ 000-default.conf的內容是:如何限制apache2轉發代理到客戶端IP列表?

<VirtualHost *:8080> 
    ProxyRequests On 
    Proxyvia On 
    <Proxy "*"> 
     Require ip <my-wlan-ip-here> 
    </Proxy> 
    ServerAdmin [email protected] 
    DocumentRoot /var/www/html 
    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

然而,這種配置中,我得到以下錯誤:「你不 有權限在此服務器上訪問http://www.cnn.com/ 」。

的問題消失,如果我從代理除去上面的「需要IP」。 如何限制轉發代理的一組允許 IP的的訪問?

Server版本:阿帕奇/ 2.4.10(Debian的) 服務器建:2015年11月28日14時05分48秒

謝謝!

回答

1

的問題是,我是綁定到所有IP的,而 請求是從127.0.0.1在瀏覽器的到來。將 更改爲下面的固定爲我的問題:

<VirtualHost *:8080> 
     ProxyRequests On 
     Proxyvia On 
     <Proxy "*"> 
       Order allow,deny 
       Allow from 172.20.160.168  # Localhost 
       Allow from 192.168.122.64  # VM debianwheezy-8.3.0 
     </Proxy> 
相關問題