0

我试图让 Plex 和 OwnCloud 都与 Apache 一起工作。我目前已经正确设置了 Plex,来自的请求http://server.com/被重写并代理到localhost:32400/web/. 我通过以下配置实现了这一点:

<VirtualHost *:80>
   ServerName mattstv.xyz
   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>

   RewriteEngine On

   RewriteCond %{REQUEST_URI} ^/owncloud$
   RewriteCond %{HTTP:X-Plex-Device} ^$
   RewriteRule ^/$ /web/$1 [P,R]

   ProxyRequests Off
   ProxyPreserveHost On
   ProxyPass / http://127.0.0.1:32400/
   ProxyPassReverse / http://127.0.0.1:32400/
</VirtualHost>

32400/web/index.html我希望保留此设置,因为它可以防止我的家人在他们的浏览器中看到时感到困惑。

我已将 OwnCloud 添加到服务器,并试图避免http://server.com/owncloud被代理或重写。我有一条规则要检查,/owncloudREQUEST_URI它似乎不起作用。

我去时收到以下回复http://server.com/owncloud

<MediaContainer size="0" content="plugins"></MediaContainer>

看起来它正在拉起主页,但没有一个脚本基于调试器解析:

铬调试器

当我完全禁用虚拟主机时,OwnCloud URL 可以正常工作。

通过阅读 Apache 文档,我相信如果重写条件失败,代理将不会发生?

4

1 回答 1

0

让它与 Plex、OwnCloud 和 SyncThing 一起使用。ProxyPass我为每个要代理的 URL添加了多个命令。

OwnCloud 监听 80 端口,因此需要绕过代理。SyncThing 在 URL 后需要一个斜杠

<VirtualHost *:80>
    ServerName server.com
    ProxyRequests Off
    ProxyPreserveHost On

    #let owncloud pass straight through
    ProxyPass /owncloud !

    #syncthing doesn't work without a trailing slash in browser URL
    RewriteRule ^/syncthing$ /syncthing/ [R]
    ProxyPass /syncthing/ http://127.0.0.1:8384/
    ProxyPassReverse /syncthing/ http://127.0.0.1:8384/

    #default go to plex
    ProxyPass / http://127.0.0.1:32400/
    ProxyPassReverse / http://127.0.0.1:32400/

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/web
    RewriteCond %{HTTP:X-Plex-Device} ^$
    RewriteRule ^/$ /web/$1 [R,L]
</VirtualHost>
于 2015-09-30T16:36:12.287 回答