網路攝影機的 Apache ReverseProxy 設定

網路攝影機的 Apache ReverseProxy 設定

我沒有嘗試過幾種不同的可能性來為我的 Apache 網路伺服器上的 AXIS 213PTZ 網路攝影機設定反向代理,以便能夠透過 HTTPS 存取它。

如果我使用命名虛擬主機,例如 axis.example.com,則它可以在以下配置下正常工作:

<VirtualHost *:80>
        ServerName axis.example.com
        ProxyPass / http://192.168.1.15:80/
        ProxyPassReverse / http://192.168.1.15:80/
</VirtualHost>

但由於我的 SSL 憑證僅對 www.example.com 有效,因此我嘗試使用目錄軸設定反向代理,如下所示:

ProxyPass /axis/ http://192.168.1.15:80/
ProxyPassReverse /axis/ http://192.168.1.15:80/

我還嘗試了更高級的方法:

ProxyPass /axis/ http://192.168.1.15/
ProxyHTMLURLMap http://192.168.1.15 /axis
<Location /axis/>
        ProxyPassReverse  http://192.168.1.15/
        SetOutputFilter proxy-html
        ProxyHTMLURLMap /           /axis/
        ProxyHTMLURLMap /axis      /axis
</Location>

但它不起作用,我認為這是因為以下原因:如果我輸入https://www.example.com/axis,URL 將被重寫為https://www.example.com/view/index.shtml,因此沒有該/axis/部分。如果我手動輸入,則會顯示相機的密碼提示,但隨後找不到網站。

有沒有辦法告訴 Apache 正確重寫 URL,或者我是否必須考慮一些特殊的事情,因為相機正在使用 .shtml 頁面?

相關內容