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 : 停止

 

相关文章:

  • 2022-03-04
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-12-25
  • 2021-07-15
猜你喜欢
  • 2022-02-17
  • 2021-08-07
  • 2021-07-18
  • 2021-10-14
  • 2022-12-23
  • 2021-10-20
相关资源
相似解决方案