1. Package the Java project into a jar package Here I use the Maven tool There are two projects here. After packaging, one is demo.jar and the other is jst.jar 2. Prepare tools 1. Server 3. Transfer the jar package to the server Just drag 3. Use Xshell to run the jar package Note: (Please configure the server's Java environment and Maven environment by yourself, which will not be described here.) cd to the jar package path and execute: nohup java -jar demo.jar >temp.txt & (Note: test interface) 4. Download and install nginx Installation Tutorial 5. Configure nginx.conf **(Note: ********* represents the server address) http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { #Listening port number listen 80; #Set the secondary domain name to be accessed server_name demo.eysource.com; #charset koi8-r; #access_log logs/host.access.log main; location /{ #Configure the project path to access (Note: This is the key point) proxy_pass http:********:9091/ #root html; # index index.html index.htm; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; root html; index index.html index.htm; } } server { #Listening port number listen 80; #Set the secondary domain name to be accessed server_name aaa.eysource.com; #charset koi8-r; #access_log logs/host.access.log main; location /{ #Configure the project path to access (Note: This is the key point) proxy_pass http:********:8080/ #root html; # index index.html index.htm; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; root html; index index.html index.htm; } } } 6Access by domain name (successful) Summarize This is the end of this article about the detailed tutorial (jar package) on how to deploy Springboot projects using Nginx on servers. For more information about Springboot project deployment on servers, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL 8.0.20 installation and configuration tutorial under Docker
>>: vue3.0+echarts realizes three-dimensional column chart
Git is integrated in vscode, and many operations ...
This article shares the specific code of jQuery t...
mysql storage engine: The MySQL server adopts a m...
There are many seemingly true "rumors" ...
When using TensorFlow for deep learning, insuffic...
cellspacing is the distance between cells in the t...
Problem description (the following discussion is ...
Table of contents 1. Vue2 syntax 2. Use of Vue3 1...
This question is very strange, so I will go strai...
1. Navigation: Unordered List vs. Other Label Ele...
The react version when writing this article is 16...
This article shares the installation and configur...
cursor The set of rows returned by the select que...
what is it? GNU Parallel is a shell tool for exec...
Table of contents 1. Open source warehouse manage...