我的设置是 ownCloud 在 192.168.200.1 的内部服务器上运行。在 43.23.104.153 处有一个带有 mod_proxy 的公共 apache,它将请求转发到内部服务器:
ProxyPass /edward https://192.168.200.1/owncloud/
ProxyPassReverse /edward https://192.168.200.1/owncloud/
owncloud 根据手册配置了反向代理支持:
$CONFIG = array (
[...]
'trusted_domains' =>.
array (
0 => '192.168.200.1',
),
# 'trusted_proxies' => [ '43.23.104.153'],
'overwritehost' => 'external.tld',
'overwritewebroot' => '/edward',
);
我可以毫无问题地从内部访问该网站https://192.168.200.1/owncloud。
但是当我导航到https://external.tld/edward登录后,我收到内部服务器错误。日志文件包含:
{"reqId":"d5K1uNLeJyGSC8LUQXgM","remoteAddr":"43.23.104.153","app":"index","message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"The requested uri(\\\/owncloud
\\\/index.php\\\/apps\\\/files\\\/) cannot be processed by the script '\\\/owncloud\\\/\\\/index.php')\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/ba
se.php(837): OC\\\\AppFramework\\\\Http\\\\Request->getRawPathInfo()\\n#1 \\\/var\\\/www\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#2 {main}\",\"File\":\"\\\/va
r\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/request.php\",\"Line \":621}","level":3,"time":"2016-04-28T10:07:16+00:00","method":"GET","url":"\/edward
\/index.php\/apps\/files\/","user":"1f75fef2-7ab7-102e-95c7-3929d8475818"}
我完全没有主意了。这是怎么回事?