500 Internal Server Error (styles and scripts)

I prepared my Ubuntu server to work with NextCloud, installed
nginx, mysql. Attached a domain with an SSL certificate.

But when I go to the page

https://mydomain.tld/index.php/apps/dashboard/ my style files and scripts do not load. I just see a page with a black background and text

Here is my nginx config

server {
    listen 80;
    server_name bloks-works.ru;

    root /var/www/nextcloud;
    index index.php index.html /index.php$request_uri;

    location / {
        rewrite ^ /index.php;
    }

    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
        deny all;
    }

    location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny all;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; # Используется PHP 8.2
        fastcgi_intercept_errors on;
        fastcgi_buffers 64 4K;
        fastcgi_buffer_size 32K;
    }

    location ~ \.(?:css|js|woff|svg|gif|png|jpg|jpeg|ico|tiff|ttf|eot|bmp|webp|map|json|webmanifest|htc)$ {
        try_files $uri /index.php$request_uri;
        access_log off;
    }

    location ~ /(?:updater|ocs-provider|ocs/v1|ocs/v2)\.php$ {
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; # Используется PHP 8.2
        fastcgi_intercept_errors on;
        fastcgi_buffers 64 4K;
        fastcgi_buffer_size 32K;
    }

    error_log /var/www/nextcloud/error.log;
    access_log /var/www/nextcloud/access.log;
}

Can anyone tell me what I did wrong?

look like your only listening to port 80 so https is not possible until it listens to port 443

Is there something specific you’re trying to accomplish by not using the tested Nginx config in the Admin Manual?

https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html

It doesn’t really make sense for us to troubleshoot your custom configuration where there is a good one in the manual already. :wink: