我对 Apache 很陌生,希望设置一个反向代理以便能够访问我从一个站点获得的一些 IP 摄像机的 Web 界面。我使用的基本布局如下:
/ Cam 1 - 192.168.1.10
Reverse Proxy - 192.168.1.6 -
\ Cam 2 - 192.168.1.11
当我单击一个链接时,它没有正确解析,URL 应该是http://192.168.1.6/cam1/settings.htm
,但它解析为http://192.168.1.6/setting.htm
Not Found
The requested URL /setting.htm was not found on this server.
Apache/2.2.22 (Debian) Server at 192.168.1.6 Port 80
我的配置在这里,我使用标准的 httpd.conf 并启用了代理和重写模块:
ProxyRequests off
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
<VirtualHost *>
Servername webserver
RewriteEngine on
RewriteRule ^/cam1/(.*)$ http://192.168.1.10$1 [P]
RewriteRule ^/cam2/(.*)$ http://192.168.1.11$1 [P]
ProxyPass /cam1 http://192.168.1.10
ProxyPassReverse /cam1 http://192.168.1.10
ProxyPass /cam2 http://192.168.1.11
ProxyPassReverse /cam2 http://192.168.1.11
</VirtualHost>
任何帮助,将不胜感激。
干杯,亚当