NC27 Nginx Config

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 27.1.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.18.0
PHP version (eg, 7.4): 8.1

The issue you are facing:

My instance is running OK but I do have the resolve “/ocm-provider/” and resolve “/.well-known/webfinger” notes in Admin page heading.

I decided to replace my rather homespun Nginx config with the current example on the help pages for NC27 but doing so results in 502 Bad Gateway page with the only other word under the header being ‘Nginx’.

I seem to have replaced all the fields that need replacing with my own info - as per “Adjust server_name, root, ssl_certificate and ssl_certificate_key to suit your needs”

Copied back my ‘cobbled’ config and all back to how it was, but I would like to get rid of all error messages. Appreciate that these are hardly unique issues on here but my preferred option would be to use the config as per the template on these pages. Hoping there might be something well known (sorry) that I’ve missed.

The config I tried is as per this page (the webroot version):
https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html?highlight=ocs-provider

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

You need to adapt the upstream php-handler to fit your php configuration:

upstream php-handler {
    server 127.0.0.1:9000;
    #server unix:/var/run/php/php7.4-fpm.sock;
}

You should find it (IP:port or socket) in your old nginx configuration or in your php configurations listen directive (I would prefer socket).

1 Like

Ah! I think I did update it but forgot to uncomment it… will check. Thanks!

Old (working) one:

upstream php-handler {
#server 127.0.0.1:9000;
server unix:/var/run/php/php8.1-fpm.sock;
}

New one:

upstream php-handler {
server 127.0.0.1:9000;
#server unix:/var/run/php/php8.1-fpm.sock;
}

I notice that the working one had the first line commented out (yet worked) should I uncomment that as well - so both lines are active?

No. Only one connection, so you should use

upstream php-handler {
#server 127.0.0.1:9000;
server unix:/var/run/php/php8.1-fpm.sock;
}

Much luck,
ernolf

1 Like

Many thanks ernolf and of course @Bernie_O
I had one new warning about setting a high number in HSTS header - did that and now…

image

And still have A+ in the security check - I’m gradually learning this stuff!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.