Quantcast
Channel: 小惡魔 – 電腦技術 – 工作筆記 – AppleBOY
Viewing all articles
Browse latest Browse all 325

HAproxy 搭配 Nginx port redirect issue

$
0
0
nginx-logo

HAproxy 是一套高效能分散式系統軟體,後端可搭配 Web 或 SQL 服務,這次在後端搭配 Nginx 出現 port redirect 問題,問題很簡單,在 Haproxy 設定 80 port 對應到內部三台 Nginx 機器,但是 Nginx port 設定 8080,這樣當我們在瀏覽網址如下:

http://aaa.bbb.ccc.ddd/test (請注意,最後沒有 slash 喔)

你會發現 Nginx 將網址轉成

http://aaa.bbb.ccc.ddd:8080/test/

為了避免 Nginx 自動將 port 加入到網址列,我們可以透過設定 port_in_redirect,Nginx 預設將此設定為 On,所以將此設定為 off,並且重新啟動 Nginx 即可

port_in_redirect off;

Viewing all articles
Browse latest Browse all 325

Trending Articles


HOY PANGIT, MAGBAYAD KA!


Henry el monstruo feliz para colorear e imprimir


Dama y vagabundo para pintar


Girasoles para colorear


Good Morning Quotes


RE: Mutton Pies (jameskoiman)


Hagibis (1946) by Francisco V. Coching


Ka riam ka beit bad ka por riam


Vimeo Create - Video Maker & Editor 1.6.0 by Vimeo Inc


Vimeo 3.42.1 by Vimeo Inc