[精讚] [會員登入]
810

spring boot 整合到 nginx 於subpath

將spring boot 位在docker中, 對外服務19090 程式佈署到nginx 伺服器的 subpath上 對

分享此文連結 //n.sfs.tw/16286

分享連結 spring boot 整合到 nginx 於subpath @igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
2023-12-18 16:17:58 最後編修
2023-12-18 10:35:17 By igogo
 

 

 

將spring boot 位在docker中, 對外服務19090

程式佈署到nginx 伺服器的 subpath上

使用reverse proxy

 

對外服務網址  https://nginx.server/user

 

spring boot 端

application.properties


server.port=19090
server.servlet.context-path=/user

其它的request mapping 依舊以根 /  出發

 

nginx.conf

   location  /user {

                proxy_pass http://spring-boot-container:19090/;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;

                proxy_set_header X-Forwarded-Prefix '/user';
     }

 

END

你可能感興趣的文章

scratch3 計算得分排名 scratch3 得分排名

[scratch] 將角色物件放到清單中,並依序讀出每個角色的X值 將角色物件放到清單中,並依序讀出每個角色的X值

台中市校園空氣品質預警 aqi

scratch 不重覆隨機取陣列值 隨機取數是在設計遊戲時, 很常用到的技巧 最簡單的就是使用運算積木裡的隨機取數範圍 但是, 如果我是想全部取出且不重覆,

[scratch2] 巢狀迴圈 有兩清單 一數字 一英文 想排出所以可能, 例如1a,1b,1c,2a,2b,2c...3c 利用巢狀迴圈 內圈累加的變

2018 hoc 掃地機器人 掃地機器人只能打掃沒有障礙物(桌椅、牆壁)的範圍,請寫程式控制機器人打掃餐廳的所有走道, 並在清掃完畢後回到充電器。

隨機好文

vue.js components 多個組件的呈現 vue.js 組件 component

vue.js component 在parent與child 傳值 component 在parent與child 傳值

讀取特定資料夾下的xls檔 讀取特定資料夾下的xls檔

臺中市雲端校務系統與Windows AD帳號整合(3) LDAP的基本概念

ubuntu ufw ufw 簡易筆記 原則禁止,例外開放 ufw default deny 啟動ufw sudo ufw enable 關掉