2

My setup is that ownCloud runs on an internal server at 192.168.200.1. At 43.23.104.153 there is a public apache with mod_proxy that forwards the requests to the internal server:

ProxyPass /edward https://192.168.200.1/owncloud/
ProxyPassReverse /edward https://192.168.200.1/owncloud/

owncloud is configured according to the manual for reverse proxy support:

$CONFIG = array (
  [...]
  'trusted_domains' =>.
  array (
    0 => '192.168.200.1',
  ),
#  'trusted_proxies' => [ '43.23.104.153'],
  'overwritehost' => 'external.tld',
  'overwritewebroot' => '/edward',
);

I can access the site internally without any problems from https://192.168.200.1/owncloud.

But when I navigate to https://external.tld/edward, after the login I get an Internal Server Error. The log file contains:

{"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"}

I'm totally out of ideas. What is wrong here?

divB
  • 538
  • 1
  • 6
  • 22
  • I think your problems stem from having different URL paths configured in various places (`ProxyPass` vs OwnCloud config). Further, your `ProxyPass` config doesn't seem to be right. From the [docs](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass): *If the first argument ends with a trailing /, the second argument should also end with a trailing /, and vice versa. Otherwise, the resulting requests to the backend may miss some needed slashes and do not deliver the expected results.* – GregL Apr 28 '16 at 11:36
  • But I want different URL paths, they have such an example in their manual. But thanks for the pointer to `ProxyPass`! Interestingly it works with trailing slashes now! When I remove the slashes (which I prefer since `external.tld/edward` is better than `external.tld/edward/`) I get redirected to `external.tld/owncloud/` which obviously ends up in a 404 ... – divB Apr 28 '16 at 21:48
  • 1
    So everything works right If you use trailing slashes? If so, I'll post an answer. – GregL Apr 28 '16 at 22:06

0 Answers0