nginx + springboot 配置


转载于:https://www.cnblogs.com/langdangyunliu/p/9548414.html

1、spring boot 访问地址http://localhost:13000/test/hello

2、配置nginx.conf文件

复制代码
upstream my_ngix {

  server localhost:13000;
 }

server {
  listen 8010;
  server_name localhost;

  location ^~ /test/hello/ {
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_pass http://my_ngix/test/hello/;
  }
}

 

复制代码

nginx -s reload :重启

start nginx : 启动ngnix

nginx -t :检查 nginx.conf配置文件语法

nginx -s stop : 停止


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM