Nginx installation - "an error occurred"

Hi,

I’m currently trying to install Nextcloud on my VPS using nginx. I’ve been using the configs from Nextcloud’s nginx manual page. I first tried configuring it to work in a subdirectory using the second example, but from what I could understand, it doesn’t seem like I can have two config files that point at the same subdomain, so for example I can’t have personal.example.com/nextcloud and still use personal.example.com for other things. I might be wrong about that, but I decided to give up on that approach for now.

So next, I tried giving it a subdomain of its own - nextcloud.personal.example.com. I copied the first config example from the docs, changed the server_name, root, ssl_certificate, and ssl_certificate_key values, and generated a new certificate with certbot for the new subdomain. After I re-started nginx, I tried to access the index.html page to finish the installation. It re-directed me to index.php, so that part works, but index.php then threw up the default “an error occurred.” page that comes with nginx. I checked the nginx error log at /var/log/nginx/error.log, but there was no entry for that error.

As far as I can tell, I edited the config file correctly, since https works, and index.html works just fine as well. I’m fairly sure I didn’t change anything else, and without a logged error, I have no idea where to go with this.

I’ve seen a thread that suggested removing “fastcgi_param front_controller_active true;” from the config file might help, but there was no change when I tried that.

Please provide a screenshot with an error on Google Chrome browser.
Thankes.

This error is generating, if your config file is demarged. Please, send your /nextcloud/config/config.php file here, or on our mail: corp@andromedacenter.com.

There is no ‘config.php’ file in my config folder. There’s just a ‘config.sample.php’. I assume that’s because I couldn’t even begin the installation yet, so the config file hasn’t been generated yet.

Wow… That’s seriuslity problem.
Please reinstall your system with NGINX+APACHE2.

I’m sorry, but how could that possibly be a problem? When you unzip the Nextcloud server archive file, it doesn’t come with a ‘config.php’ file. It has to be generated later during the installation. Since I can’t even start the installation, it would be very strange if I did have a ‘config.php’ file somehow. Re-installing my entire system (with both nginx and Apache for some reason) wouldn’t change that one bit, unless I’m seriously missing something.

The problem is nginx not support an htaccess rulles. If you need to start installation process, you can install Apache2 server to slove this problem. We recomendate you, to using free VESTACP Panel.
https://vestacp.com/

So you’re saying there’s no way to get this to work with nginx? That sound extremely unlikely, there are many people who’ve managed to install Nextcloud with nginx.

Do you have php installed and does the upstream_handler in your nginx configuration pointing to the correct socket (or port) of your installed php version?

I do have php installed. I made sure to install all the dependencies that are listed in the docs. I even ran phpinfo() to make sure everything is set up properly, and it worked fine.

Here’s a good guide. https://www.c-rieger.de/nextcloud-13-nginx-installation-guide-for-ubuntu-18-04-lts/
Maybe there’s something you have forgotten.

I think the problem is that you have been looking at an old tutorial. A lot of things changed in the new nginx mainline version, especially directories.

for example,
Your website configuration is located at /etc/nginx/conf.d/default.conf
Your website HTML files are located at /usr/share/nginx/html

https://hostup.org/blog/how-to-install-configure-latest-nginx-mainline-version-on-ubuntu/ here is a good tutorial that will work for ubuntu 18.04 and the newest version of nginx.