Current location - Quotes Website - Collection of slogans - How to deploy Spring Boot to different servers?
How to deploy Spring Boot to different servers?
Spring Boot can be deployed to different servers in the following two ways:

1. Start with jar package, that is, run with tomcat built in spring boot. Just configure jdk 1.8 and above on the server. No external tomcat is needed. The specific steps are as follows:

-Can packaging.

-put the jar package in any directory and execute the following command: nohup Java-jartest.jar > temp.txt &; `//This method will input the log file into the file you specify, otherwise it will be created automatically. The process will run in the background.

-If you need to deploy multiple Spring Boot projects on the server, you can use different port numbers to distinguish different projects. The command is: `java-jarxxx.jar-server.port = xxxx`, where xxxx is the port number.

2. If you need to use a reverse proxy server such as Nginx to access the Spring Boot project, you need to add the corresponding configuration in the Nginx configuration file.