Cannot connect through LAN

I have loaded NC three times on my Linux 18.04 server. The first time I could log on through a desktop 18.04 machine sitting next to it. Once all was working the way I wanted I decided to reinstall Linux on the server to fix an unrelated problem.

I then reinstalled NC. After the installation I was not able to connect to NC in order to go through the wizard. I tried every combination of .com; no .com; http://; https://. I used .nextcloud. The name correctly resolves to the IP address of my server, although I tried using the numerical IP as well. I use the host name to ssh into the server. I have also used all combinations I can think of in the server section of conf.d. With each change of the conf.d I did a nginx -t test and a reload. Eventually I reinstalled NC for the 3rd time with the same results.

One odd thing I noticed is that the desktop app for NC starts up with an error saying it got no response from a status.php file in an owncloud directory. That must be a hard coded error statement. find / -name does find nextcloud directories but no owncloud directories. If I browse to http://my-server I get the nginx welcome page.

I’m about at the end of my rope. Can anyone tell me the correct input for server name in conf.d and the correct URL for connecting to the NC wizard so I can finish the installation?

Thank you for any help. Steve

i am not a guru with nginx as i use apache.

updated message

First thing, you may experience strange php error if you have made error during php install. The good command line for all php/nextcloud dependencies is:

$ apt-get install php-cli php-json php-curl php-imap php-gd php-mysql php-xml php-zip php-intl php-imagick php-mbstring php-fpm

UPDATE END

But:
So, i imagine you have completed the previous task:

  • NGINX install and configuration.
  • Download and install of nextcloud ( copy of files to good locations ).
  • Unix rights to folders and Files.
  • PHP and Modules install.
  • PHP-FPM, install, pool creation, tuning.
  • DB install and configuration.
  • Domaine Name and Vhost <---- I believe your problem is somewhere here with /etc/nginx/sites-available/nextcloud
  • SSL/TLS install and/or configuration.
  • HTTP2 initialisation ( optional )
  • PHP-FPM Nextcloud tuning to avoid time-out
  • FINAL nextcloud install via http://cloud.mondomaine.com/ .

This is a working /etc/nginx/sites-available/nextcloud with commented line for you ( NO SSL AT THIS TIME ) !!

upstream php-handler {
    server                        unix:/var/run/nextcloud.sock;
}
 
server {
    listen                        80;
    listen                        [::]:80;

####### modify for your config #########
server_name cloud.mondomaine.com;

    # Path to the root of your installation
    root                          /var/www/nextcloud/;

###################################

    # Add headers to serve security related headers
    add_header                    X-Content-Type-Options nosniff;
    add_header                    X-XSS-Protection "1; mode=block";
    add_header                    X-Robots-Tag none;
    add_header                    X-Download-Options noopen;
    add_header                    X-Permitted-Cross-Domain-Policies none;
    add_header                    Strict-Transport-Security 'max-age=31536000; includeSubDomains;';
 
    location = /robots.txt {
        allow                     all;
        log_not_found             off;
        access_log                off;
    }
 
    location = /.well-known/carddav {
      return                      301 $scheme://$host/remote.php/dav;
    }
 
    location = /.well-known/caldav {
      return                      301 $scheme://$host/remote.php/dav;
    }
 
    # set max upload size
    client_max_body_size          512M;
    fastcgi_buffers               64 4K;
 
    # Enable gzip but do not remove ETag headers
    gzip                          on;
    gzip_vary                     on;
    gzip_comp_level               4;
    gzip_min_length               256;
    gzip_proxied                  expired no-cache no-store private no_last_modified no_etag auth;
    gzip_types                    application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
 
    location / {
        rewrite                   ^ /index.php$uri;
    }
 
    location ~ ^/.well-known/acme-challenge/* {
        allow                     all;
    }
 
    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
        deny                      all;
    }
 
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny                      all;
    }
 
    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+).php(?:$|/) {
        fastcgi_split_path_info   ^(.+.php)(/.*)$;
        include                   fastcgi_params;
        fastcgi_param             SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param             PATH_INFO $fastcgi_path_info;
        fastcgi_param             modHeadersAvailable true;
        fastcgi_param             front_controller_active true;
        fastcgi_pass              php-handler;
        fastcgi_intercept_errors  on;
        fastcgi_request_buffering off;
    }
 
    location ~ ^/(?:updater|ocs-provider)(?:$|/) {
        try_files                 $uri/ =404;
        index                     index.php;
    }
 
    # Adding the cache control header for js and css files
    # Make sure it is BELOW the PHP block
    location ~* .(?:css|js|woff|svg|gif)$ {
        try_files                 $uri /index.php$uri$is_args$args;
        add_header                Cache-Control "public, max-age=15778463";
        add_header                X-Content-Type-Options nosniff;
        add_header                X-XSS-Protection "1; mode=block";
        add_header                X-Robots-Tag none;
        add_header                X-Download-Options noopen;
        add_header                X-Permitted-Cross-Domain-Policies none;
        # Optional: Don't log access to assets
        access_log                off;
    }
 
    location ~* .(?:png|html|ttf|ico|jpg|jpeg)$ {
        try_files                 $uri /index.php$uri$is_args$args;
        # Optional: Don't log access to other assets
        access_log                off;
    }
}

When modified, e
sudo ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/nextcloud

Hope this will help.

Hello,
Thank you very much for your detailed and insightful reply. Being Father’s Day I have to leave soon but you have given so much info I can hardly wait to get started. In the time I had I checked a few things.

I don’t have a nextcloud directory in /etc/nginx/sites-available/ . I do have a file called default in that path, though. It’s a reference file from Nginx with a lot of good info in it. I also don’t have /var/run/nextcloud.sock. There are a lot of files in that path, but no nextcloud.sock. I also don’t have the line labeled server in conf.d. I have a line labeled server_name. I suspect a majority if not all of these differences relate to using nginx rather than apache.

As soon as I return from the event the kids have planned, I’ll get started. Thank you again. You have given me a lot of info to check out.
Regards, Steve

nginx and apache2 advantage is the abilities to brake down large conf files in small vhost files.
The default is … the default host. You can use it, or use vhost.
My 2 dineros advise is to use vhost.

At this point, not having /var/run/nextcloud.sock is normal.

You really need to follows the steps from NGINX install and configuration to _FINAL nextcloud install

I also don’t have the line labeled server in conf.d. I have a line labeled server_name.

This means you did not follows the steps, because this line is automaticaly add when php modules are installed.
Nextcloud is NOT a standalone install who is going to to everything.

differences relate to using nginx rather than apache
Yes, there is differences. Well explain here: https://www.hostingadvice.com/how-to/nginx-vs-apache/
today, the real bottleneck is not the web-server apache2 or nginx, but mostly the PHP-core and others stuff running below the web-server.

I did a nextcloud install on 18.04. I did kept a very details step by step todo-list. If ever, i can give you some step by step things to do … just need to dig in my archives

PS: hoping you understant me, sometimes my french take over !!!