Okay I had accidentally closed this tab so I apologise if this is short or I’m missing anything.
I just installed Nextcloud on my production DietPi installation. However, after rebooting as it had requested and navigating to http://this.is.an.ip/nextcloud, I get a 502 error from Nginx (my httpd of choice). I hadn’t done any configuration between installing Nextcloud and going to the page (just the reboot) so I’m wondering if it’s my existing Nginx configuration that might be causing issues.
It’s not directly integrated into nginx.conf (it’s loaded as an include in a separate file).
many thanks for your report. I did a small test an my RPi3B+ and changed default web server to nginx and installed NextCloud from dietpi-software catalogue. For me this is working fine and I can open NextCloud Login page without issues. I did not do any config changes. I just install NextCloud.
The last comment I don’t understand. What do you like to say?
It’s not directly integrated into nginx.conf (it’s loaded as an include in a separate file).
Nextcloud config for nginx is located at /etc/nginx/sites-dietpi/dietpi-nextcloud.conf and in general config files are spread over various directories and taken together by a couple of include
root@DietPi3:/etc/nginx# cat nginx.conf|grep include
include /etc/nginx/modules-enabled/*.conf;
include mime.types;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
My conf also contains these includes (along with the extra include), and the directory structure produced by ls -al|grep sites.
I have attempted both direct IP access and the fqdn assigned by the DNS server here (which matches the hostname of the machine); both produce the same result. Even tried curling it locally on the machine (also a Pi3b+) to no avail.
Correct. I had added the line include nginx-eizen.conf (and only this line) as I moved and adapted the old production site configuration to this machine.
For completeness, I commented out this line, reloaded nginx, and the problem is not resolved.
what happen if you just enter http://your.ip/ Does it give the Bad Gateway message as well?
Usually a 502 Bad Gateway error means that the web server you’ve connected to is acting as a proxy for relaying information from another server, but it has gotten a bad response from that other server. Which is strange, as on standard setup nginx will not act as proxy. Or did you configure something like this?
After doing some research of my own with this lead, it took me to this Github issue (https://github.com/laravel/homestead/issues/1031) in which it seems to be an issue with php7.3-fpm itself. Adjusting the nginx.conf to use 7.2’s fpm makes NextCloud work as intended. Issue resolved!
# Upstream to abstract back-end connection(s) for PHP
upstream php {
+ server unix:/run/php/php7.2-fpm.sock;
- server unix:/run/php/php7.3-fpm.sock;
It seems that this was the reason why only Nextcloud was broken, as in my include config I was defining fastcgi manually.
I had tried using both apt install --reinstall and apt remove, then apt install, but neither of those resolved it either (it just wouldn’t regenerate the socket).
ok strange, just keep in mind that active support for php7.2 already ended and it will get security fixes only until end of this year. sooner or later you might need to switch to php7.3