I already have a tomcat server running in a VM with port as 443 and redirect port as 8443. Can I configure the redirect port for spring boot application also as 8443 and run in same VM? Would I face error like port already in use? If yes, are there any specific port to be used for this purpose? I would not like to try since this is a production environment VM.
-
Does this answer your question? [Spring Boot redirect HTTP to HTTPS](https://stackoverflow.com/questions/26655875/spring-boot-redirect-http-to-https) – Mebin Joe Apr 08 '20 at 04:28
1 Answers
By default the https port used is 9393
in springboot.So , in your application if you need it to be 8443 , you need to configure it in the application.properties
or application.yml
like
application.yml
server:
port: 8443
or
application.properties
server.port=8443
Yes, you will have issues if some other application is using the same https port on the same VM, you will have to find a port that is not used by any other application and assign it for your springboot application. Check in your vm if any other application is already mapped to this port, if not you can use this port without any issues.
Please note that :
If HTTPS is enabled, it will completely replace HTTP as the protocol over which the REST endpoints and the Data Flow Dashboard interact. Plain HTTP requests will fail - therefore, make sure that you configure your Shell accordingly.
Spring doc.

- 5,706
- 6
- 22
- 39