After nginx is configured, the domain name cannot be accessed, but the domain name + port can be accessed. What is the reason for this?

server {

    listen 80;
    server_name  ;
 -sharp  listen [::]:80;

    -sharproot /home/wunder/yueyar;

    location / {
            -sharp First attempt to serve request as file, then
            -sharp as directory, then fall back to displaying a 404.
             proxy_pass http://0.0.0.0:8001;
             proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

            -sharp try_files $uri $uri/ =404;
    }
    location /static {
            alias  /home/wunder/MyVirtualenv/yueyar/mysite/static;
}

}

Mar.18,2021

Port is the default server root directory


confirm whether nginx is started successfully. Nine times out of ten, according to what you said, nginx failed, port a. 80 conflict failed to start, b. Syntax error failed startup, c. nginx is normal, the configuration is not refreshed. That's all I can think of. I forgot to add that your proxy_pass is the reverse of what to solve.

Menu