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
Often, we may need to export local database data ...
This article will introduce how to save IP addres...
This article example shares the specific code for...
This article example shares the specific code of ...
Problem Reproduction Alibaba Cloud Server, using ...
VMware version: VMware-workstation-full-16 VMware...
Table of contents Breaking down components Left P...
Recently, I have been learning to use nginx to pl...
Operation effect html <head> <meta chars...
http://www.cppcns.com/shujuku/mysql/283231.html Y...
Table of contents Standards for smooth animation ...
This article collects the fonts used in the logos...
1. Pull the MySQL image Get the latest MySQL imag...
We know that the properties of the select tag in e...
Ubuntu 15.04 opens MySQL remote port 3306. All th...