Nginx specifies multiple ports to access the website

the default web page is port 80. I want to specify dozens of ports, such as 80, 81, 82, 83, and so on. Other configurations are the same, how to write simply

Feb.11,2022

you can listen to multiple ports directly
        listen       80;
        listen       81;
        listen       82;
        server_name  www.example.org;

configuring multiple server is possible, but not concise.

http{
   
    server{
        listen 80;
        server_name  localhost;
    }
    server{
        listen 81;
        server_name  localhost;
    }
    server{
        listen 82;
        server_name  localhost;
    }
}
Menu