Yes, nginx can listen to the port number that tomcat is currently using. In nginx configuration file, this function can be realized by setting the listening port. For example, if you want nginx to listen on port 8080, you can write this in the nginx configuration file:
Server {listen 8080
Server_name local host;
...
}
In this way, nginx will listen on port 8080 and forward all requests connected to this port to tomcat for processing.