我在Debian 9上安装了Logitech媒体服务器服务器(以前称为squeezebox) . 我在端口9000上访问Web界面: http://192.168.1.58:9000
我已经安装了Apache2作为反向代理,因此这个URI转发到Web界面: http://192.168.1.58/Squeezebox
.
Apache站点配置文件:订单拒绝,允许所有人允许
ProxyPreserveHost在ProxyPass / Squeezebox / http://127.0.0.1:9000/ ProxyPassReverse / Squeezebox / http://127.0.0.1:9000/
但是,当我访问URI时,我在Chrome控制台上有几个错误:
(index):10 GET http://192.168.1.58/html/ext/resources/css/ext-main.css?r=1520781386 net::ERR_ABORTED
(index):11 GET http://192.168.1.58/html/lightbox/lightbox.css?r=1520781386 net::ERR_ABORTED
(index):12 GET http://192.168.1.58/slimserver.css?r=1520781386 net::ERR_ABORTED
(index):13 GET http://192.168.1.58/skin.css?r=1520781386 net::ERR_ABORTED
(index):86 GET http://192.168.1.58/html/js-main.html?r=1520781386 net::ERR_ABORTED
(index):60 GET http://192.168.1.58/html/images/background.png 404 (Not Found)
(index):253 GET http://192.168.1.58/html/images/spacer.gif 404 (Not Found)...
但是,当我删除Apache站点配置文件中的“Squeezebox”路径时,它可以工作:
<Virtualhost *:80>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
</Virtualhost>
我的第一个配置文件出了什么问题?
[编辑]实际上,我确实设法做我想要的但是非常讨厌:
<VirtualHost *:80>
ProxyRequests off
RewriteEngine On
redirectmatch ^/squeeze$ /squeeze/
rewritecond %{REQUEST_URI} ^/squeeze/
rewriterule (.*) $1 [PT]
rewritecond %{HTTP_REFERER} http://192.168.1.58/squeeze/ [OR]
rewritecond %{HTTP_REFERER} http://192.168.1.58/clixmlbrowser/ [OR]
rewritecond %{HTTP_REFERER} http://192.168.1.58/settings/ [OR]
rewritecond %{HTTP_REFERER} http://192.168.1.58/html/ [OR]
rewritecond %{HTTP_REFERER} http://192.168.1.58/plugins/ [OR]
rewritecond %{HTTP_REFERER} http://192.168.1.58/music/
rewriterule ^/(.*) /squeeze/$1 [PT]
rewriterule ^/clixmlbrowser/(.*) /squeeze/clixmlbrowser/$1 [PT]
rewriterule ^/settings/(.*) /squeeze/settings/$1 [PT]
rewriterule ^/html/(.*) /squeeze/html/$1 [PT]
rewriterule ^/plugins/(.*) /squeeze/plugins/$1 [PT]
rewriterule ^/music/(.*) /squeeze/music/$1 [PT]
ProxyPass /squeeze http://127.0.0.1:9000 timeout=1200
ProxyPassReverse /squeeze http://127.0.0.1:9000 timeout=1200
</VirtualHost>
任何人都有科学改变重写和重写,以便更“通用”(没有硬编码的IP地址)?