nginx主要是个代理映射到另个地址

1. centos部署一个springboot jar 项目,这里用一个现成的项目,端口是8090。

 nohup java -jar springboot-thread-0.0.1-SNAPSHOT.jar  &

 nginx 部署springboot 项目

 

2. 配置nginx文件,我的nginx的安装目录是/usr/local/nginx

  sudo vi /usr/local/nginx/conf/nginx.conf

nginx 部署springboot 项目

 增加springboot的项目路径

  proxy_pass http://192.168.101.131:8090;

 注释  root html;  index inex.html index.htm;

3. 重启nginx

 ./nginx -s reload
 

4. 在网页输入http://192.168.101.131/multithreading/dotask 访问,发现这里不需要端口,而且没有一个小绿叶。

nginx 部署springboot 项目

 

相关文章:

  • 2021-05-28
  • 2018-05-30
  • 2021-10-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2023-03-19
  • 2021-12-19
  • 2021-08-27
  • 2021-12-31
  • 2021-07-14
相关资源
相似解决方案