Hey I had the same problem with nginx and nextcloud. I solved by changing
location ^~ /lool
into
location ~ /lool
I found that somewhere else here on the forums after scratching my head for several hours.
Still don’t know exactly what the problem was, but it had to do with the url links that nginx passes along.