服务器使用Nginx部署Springboot项目的详细教程(jar包)

服务器使用Nginx部署Springboot项目的详细教程(jar包),第1张

服务器使用Nginx部署Springboot项目的详细教程(jar包)

本文详细介绍了用服务器应用Nginx部署Springboot项目的详细示例教程(jar包)。按照图文并茂的方式非常详细,对大家的学习、培训或者工作都有一定的参考价值,盆友一定要参考。

1、把java项目变成jar包

我这里用的是maven工具。

这里有两个项目,一个是demo.jar,一个是安装包后的jst.jar。

2。提前准备好工具

1.服务器
2。网站域名(注:已备案)
3.XShell用于连接服务器。

3。将jar包传递给服务器


直接拖放即可

3。应用Xshell来运行jar包

注意:(请提供自己的java自然环境和服务器的maven自然环境,这里不做描述。)


cd转jar包:nohupJava-jardemo.jar>;临时文本&
启动两个jar包后,应用程序ip和服务器端口浏览套接字


(注:测试接口)

4。安装并下载nginx

使用教程

5。配备nginx.conf

**(注:*********表示服务器的详细地址)

http{ includemime.types; default_typeapplication/octet-stream; #log_formatmain'$remote_addr-$remote_user[$time_local]"$request"' #'$status$body_bytes_sent"$http_referer"' #'"$http_user_agent""$http_x_forwarded_for"'; #access_loglogs/access.logmain; sendfileon; #tcp_nopushon; #keepalive_timeout0; keepalive_timeout65; #gzipon; server{ #监视的服务器端口 listen80; #设定浏览的二级域名 server_namedemo.eysource.com; #charsetkoi8-r; #access_loglogs/host.access.logmain; location/{ #配备浏览的项目途径(注:这儿关键) proxy_passhttp:********:9091/ #roothtml; #indexindex.htmlindex.htm; proxy_set_headerHost$host; proxy_set_headerX-Real-IP$remote_addr; proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for; client_max_body_size100m; roothtml; indexindex.htmlindex.htm; } } server{ #监视的服务器端口 listen80; #设定浏览的二级域名 server_nameaaa.eysource.com; #charsetkoi8-r; #access_loglogs/host.access.logmain; location/{ #配备浏览的项目途径(注:这儿关键) proxy_passhttp:********:8080/ #roothtml; #indexindex.htmlindex.htm; proxy_set_headerHost$host; proxy_set_headerX-Real-IP$remote_addr; proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for; client_max_body_size100m; roothtml; indexindex.htmlindex.htm; } } }

6根据网站域名浏览(成功)

摘要[/s2/]

至此,这篇关于NginxSpringboot项目服务器部署的详细示例教程(jar包)已经在这里详细介绍过了。有关Springboot项目的服务器部署的大量信息,请搜索您以前的文章或再次访问下面的相关文章。期待你以后的申请!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/774457.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-03
下一篇 2022-05-03

发表评论

登录后才能评论

评论列表(0条)

保存