NC behind an IIS Reverse Proxy

hi!
I just installed NC the first time on a debian 9 VM on my Windows Server 2016 Server at home. NC works fine, as long as I only use my internal hostname cloud.mydomain.local, except for the SSL errors, since I created and installed a certificate for my external hostname cloud.mydomain.com. Unfortunately setting up a working reverse Proxy isn’t working for me. I set it up in IIS by creating a Rewrite Rule with ARR like I did for multiple other webinterfaces in my local network, but I keep getting “Error 500 - Internal Server Error”. The rerouting itself seems to work, I can browse a helloworld.txt put in the www-root, just NC isn’t cooperating yet.

What I have done so far:
tried with and without SSL-Offloading in IIS
added a ‘trusted_proxies’ => [‘serverwithiisonit.mydomain.local’] Entry into the config.php
added ‘overwritehost’ => ‘cloud.mydomain.local’ which just killed my possibility to use nextcloud by its local hostname
added trusted_domains for internal and external hostname

Am I missing an important setting? What’s going wrong here?
What logfiles can I check?

best regards
RockNLol

It’s me again. I have found a solution and want to document it here, if somebody has a similar problem. The problem was the http-compression which I discovered when enablind detailed error messages in IIS which resulted in an Error 500.52 complaining about a not working proxy because of gzip compression.

I just followed the instructions at https://blogs.msdn.microsoft.com/friis/2016/08/25/iis-with-url-rewrite-as-a-reverse-proxy-part-2-dealing-with-500-52-status-codes/
which stores the HTTP_ACCEPT_ENCODING part of the original http request and rewrites it to blank, so that NC thinks that the client doesn’t support it and sends out uncompressed data. An additional outbound rule adds the stored HTTP_ACCEPT_ENCODING back to the outbound data.

hope this helps someone.

2 Likes

I have been struggling with this issue for awhile. Thanks.