Hi,
After setting up my nextcloud, I encountered a weird issue:
Several things on the webpage return Error 500. Such as:
- moving files from the webpage
- enabling / disabling apps
- removing configurations (e.g. from LDAP / AD integration app)
I think that the issue is related to my reverse proxy configuration as everything works fine if I directly communicate with the server (which is not the way I intend to use it).
Is there something crucial which I am missing? I have attached my configurations below.
Reverse Proxy Server:
Win Server 2016 w/ IIS 10.0 & PHP v7.1.10 & SSL
Nextcloud Server:
4.13.11-1-ARCH w/ Apache/2.4.29 & PHP v7.1.11
running Nextcloud v12.0.3
config.php
<?php
$CONFIG = array (
'maintenance' => false,
'instanceid' => '*****',
'passwordsalt' => '*****',
'secret' => '*****',
'trusted_domains' =>
array (
0 => '<ext. URL>',
1 => '<own local ip>',
2 => '<internal own dns name>',
),
'trusted_proxies' =>
array (
0 => '<reverse proxy ip>',
),
'overwritehost' => '<ext. URL>',
'overwriteprotocol' => 'https',
'overwritewebroot' => '',
'overwriteconaddr' => '^***\.***\.***\.***$', <reverse proxy ip>
'datadirectory' => '/srv/mounts/data-share',
'dbtype' => 'mysql',
'version' => '12.0.3.3',
'dbname' => 'nextcloud',
'dbhost' => '<sql-server-ip>',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nxSQL',
'dbpassword' => '*****',
'installed' => true,
'forwarded_for_headers' =>
array (
0 => 'HTTP_X_FORWARDED_FOR',
1 => 'HTTP_X_FORWARDED',
2 => 'HTTP_FORWARDED_FOR',
),
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
'memcache.local' => '\\OC\\Memcache\\APCu',
'loglevel' => '0',
);
IIS config
<?xml version="1.0" encoding="UTF-8"?><system.webServer>
<rewrite>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.178.15:80/(.*)" />
<action type="Rewrite" value="http{R:1}://[DOMAIN]/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://[Nextcloud-Server-IP]:80/{R:1}" />
<serverVariables>
</serverVariables>
</rule>
</rules>
</rewrite>
<staticContent>
<clientCache cacheControlMode="NoControl" />
</staticContent>
<httpProtocol allowKeepAlive="true">
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=15552001" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering allowDoubleEscaping="true" />
</security>
</system.webServer>