Nginx is configured but cannot be accessed through a domain name

my server has been configured with a sub-domain name, such as aaa.bbb.com. A new index.html,nginx configuration has been created under root as follows, but the welcome page of nginx appears when accessing aaa.bbb.com. It is not the index.html, under root who wants to know if there is anything wrong with this configuration. The local ping domain name can also be ping connected.


server {
    listen 80;
    server_name www.bbb.com;
    root /root/express/public/;
    location / {
        proxy_pass  http://127.0.0.1:3000;
         -sharpProxy Settings proxy_redirect     default; proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
}
server {
    listen 80;
    server_name aaa.bbb.com;
    root /root/;
    index index.htm index.html index.php; 
}

now delete the first paragraph of server and still can"t access it.

Mar.18,2021

  1. check nginx's error.log to see what's wrong
  2. Is there a problem with the format of the

    configuration? Listen and server_name seem to be followed by a ":" that doesn't need a colon. Use the command nginx-t to see if there is a problem with the configuration.

    server {
        listen: 80;
        server_name: aaa.bbb.com;
        root /root/;
        index index.htm index.html index.php; 
    }
Menu