Not working due to Nginx issue

I installed jitsi-meet on Ubuntu 20.04 via the package, but since I had previously installed Nginx 1.22.1 in some other way, I uninstalled the included Nginx installation and made the original installation work. I confirmed that Nginx 1.22 worked very well, but jitsi-meet would always work intermittently. For example, for a while it would show a normal page, and then after a while it would show the “Welcome to Nginx” page. I’ve attached the slightly modified configuration file below, what should I do to fix it?

types {
# nginx's default mime.types doesn't include a mapping for wasm or wav.
    audio/wav            wav;
}
upstream prosody {
    zone upstreams 64K;
    server 127.0.0.1:5280;
    keepalive 2;
}
upstream jvb1 {
    zone upstreams 64K;
    server 127.0.0.1:9090;
    keepalive 2;
}
server {
    listen 80;
    listen [::]:80;
    server_name {domain};

    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root         /usr/share/jitsi-meet;
    }
    location = /.well-known/acme-challenge/ {
        return 404;
    }
    location / {
        return 301 https://$host$request_uri;
    }
}
server
{
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
    server_name {domain};
    index index.html index.htm;
    root /usr/share/jitsi-meet;
    ssi on;
    ssi_types application/x-javascript application/javascript;
    error_page 404 static/404.html;

    gzip on;
    gzip_types text/plain text/css application/javascript application/json image/x-icon application/octet-stream application/wasm;
    gzip_vary on;
    gzip_proxied no-cache no-store private expired auth;
    gzip_min_length 512;

    #SSL-START SSL related configuration, do NOT delete or modify the next line of commented-out 404 rules
    #error_page 404/404.html;
    #HTTP_TO_HTTPS_START
    #if ($server_port !~ 443){
    #    rewrite ^(/.*)$ https://$host$1 permanent;
    #}
    #HTTP_TO_HTTPS_END
    ssl_certificate    {/path/to/}fullchain.pem;
    ssl_certificate_key    {/path/to/}privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
    error_page 497  https://$host$request_uri;
    set $prefix "";

    #SSL-END

    location = /config.js {
        alias /etc/jitsi/meet/{domain}-config.js;
    }

    location = /external_api.js {
        alias /usr/share/jitsi-meet/libs/external_api.min.js;
    }

    location = /_api/room-info {
        proxy_pass http://prosody/room-info?prefix=$prefix&$args;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }

    # ensure all static content can always be found first
    location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
    {
        add_header 'Access-Control-Allow-Origin' '*';
        alias /usr/share/jitsi-meet/$1/$2;

        # cache all versioned files
        if ($arg_v) {
            expires 1y;
        }
    }

    # BOSH
    location = /http-bind {
        proxy_pass http://prosody/http-bind?prefix=$prefix&$args;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header Connection "";
    }

    # xmpp websockets
    location = /xmpp-websocket {
        proxy_pass http://prosody/xmpp-websocket?prefix=$prefix&$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        tcp_nodelay on;
    }

    # colibri (JVB) websockets for jvb1
    location ~ ^/colibri-ws/default-id/(.*) {
        proxy_pass http://jvb1/colibri-ws/default-id/$1$is_args$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        tcp_nodelay on;
    }

    # load test minimal client, uncomment when used
    #location ~ ^/_load-test/([^/?&:'"]+)$ {
    #    rewrite ^/_load-test/(.*)$ /load-test/index.html break;
    #}
    #location ~ ^/_load-test/libs/(.*)$ {
    #    add_header 'Access-Control-Allow-Origin' '*';
    #    alias/usr/share/jitsi-meet/load-test/libs/$1;
    #}

    location ~ ^/([^/?&:'"]+)$ {
        try_files $uri @root_path;
    }

    location @root_path {
        rewrite ^/(.*)$ / break;
    }

    location ~ ^/([^/?&:'"]+)/config.js$
    {
        set $subdomain "$1.";
        set $subdir "$1/";

        alias /etc/jitsi/meet/{domain}-config.js;
    }

    # BOSH for subdomains
    location ~ ^/([^/?&:'"]+)/http-bind {
        set $subdomain "$1.";
        set $subdir "$1/";
        set $prefix "$1";

        rewrite ^/(.*)$ /http-bind;
    }

    # websockets for subdomains
    location ~ ^/([^/?&:'"]+)/xmpp-websocket {
        set $subdomain "$1.";
        set $subdir "$1/";
        set $prefix "$1";

        rewrite ^/(.*)$ /xmpp-websocket;
    }

    location ~ ^/([^/?&:'"]+)/_api/room-info {
        set $subdomain "$1.";
        set $subdir "$1/";
        set $prefix "$1";

        rewrite ^/(.*)$ /_api/room-info;
    }

    # Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
    location ~ ^/([^/?&:'"]+)/(.*)$ {
        set $subdomain "$1.";
        set $subdir "$1/";
        rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
    }
}

what is the output for

ls -alh /etc/nginx/sites-enabled
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan 10 10:00 .
drwxr-xr-x 8 root root 4.0K Jan 10 10:00 ..
lrwxrwxrwx 1 root root   34 Jan 10 10:00 default -> /etc/nginx/sites-available/default
lrwxrwxrwx 1 root root   46 Jan 10 10:00 {domain}.conf -> /etc/nginx/sites-available/{domain}.conf

grep -w 443 /etc/services
grep -w 80 /etc/services

do you use “default” for another virtual host?
if not
delete link from site-enable

Still abnormal

nginx -t

nginx: the configuration file {pathto}/nginx.conf syntax is ok
nginx: configuration file {pathto}/nginx.conf test is successful

I see that you have two virtual hosts
default and your domain
lrwxrwxrwx 1 root root 34 Jan 10 10:00 default → /etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 46 Jan 10 10:00 {domain}.conf → /etc/nginx/sites-available/{domain}.conf

virtual hosts “default” do you use it?

if you don’t use it
delete link from /etc/nginx/site-enable/default
nginx -t
service nginx restart

server {
listen 80;
listen [::]:80;
server_name {domain};
index index.html index.htm;
root /usr/share/jitsi-meet;

save
nginx -t
service nginx restart
http://domain

try without certificate
port 80

I did all the steps, but it is still abnormal

nmap localhost
is port 4443 in use?

No

try the domain on port 80
without certificate
http://domain

maybe the certificate is installed for virtual host “default”

“Welcome to Nginx” page

so you have a virtual host
and from what I can see it can only be “default”

Another possibility, there may be a second nginx process.

Can you try these

rm /etc/nginx/sites-enabled/default
systemctl restart nginx

ps auxww | grep nginx

I deleted the default config file

I made sure there was only one Nginx running and it was the one I wanted

Is nginx behind a proxy?

Do you use some kind of DNS load balancing?