Do Spring Boot applications with embedded tomcat web servers that run on top of IIS as an executed JAR file always require specifying the port in the URL in order to hit the application in the browser?

2

There are 2 answers

0
Avinash On BEST ANSWER

All the production application url does not have port number in its url, either it runs on internal network or public web. On the other hand java based application servers runs on ports other than 80, for instance tomcat runs on 8080 by default. We can change the default port of tomcat to 80 but we use a web server like nginx and make it run on port 80 and forward the request to tomcat or java application server.

There are following benefits of using a web/proxy server like nginx which runs on port 80 instead of changing the tomcat or application server's port to 80.

  1. In production environment tomcat/other app servers runs in multiple nodes, we can use nginx to work as load balancer.
  2. The cumbersome url is prettified here easily (here the port number is removed)
  3. There are many advantages of nginx like servers, you can google it for more understanding.

The following thread explains about forwarding request from nginx to tomcat.

Nginx configuration to pass site directly to tomcat webapp with context

0
TomOw On

Yes if you would use port 80 which is the default one. Let's say that your application is running at 1.1.1.1:80 you would access it either via 1.1.1.1 or 1.1.1.1:80