nginx + springboot 配置


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