Gin framework api should work on 80 and 443

I have developed api using gin framework on port 7001. It is working perfectly.

Now customer not allowing custom port asking me to migrate on 80 and 443.

How to achieve this

Nginx as proxy? Nginx listening to 80/443 and forwarding to port 7001?

server {
    server_name api.go4webdev.org;
                      
    location / {
        proxy_pass http: //localhost:7001;
    }
}

How I did this

Thank you :pray:

I have two application server ( golang gin ) on same server for 2 customer .

all api are same but little bit changes as per their reequipment.

how to configure in ngnix .

at present I am assign two different port and managing

server {
    server_name api1.go4webdev.org;
                      
    location / {
        proxy_pass http: //localhost:7001;
    }
}

server {
    server_name api2.go4webdev.org;
                      
    location / {
        proxy_pass http: //localhost:7002;
    }
}

server {
server_name api1.go4webdev.org;

location / {
    proxy_pass http: //localhost:7001
    Login http://localhost:7001
    Getemp http:// localhost:7001
}

}

server {
server_name api2.go4webdev.org;

location / {
    proxy_pass http: //localhost:7002

Login http://localhost:7002
Getemp http://localhost:7002
}
}

I have to map all api like this

This is not what I am used to. If I want to have many sub domains, I use to do this:

server {
    server_name api.go4webdev.org Login.go4webdev.org Getemp.go4webdev.org;

    location / {
        proxy_pass http://localhost:7001;
    }
}