987大大誤認為是多個dns指向同一部web server,實際上Y大要表達的是各種ddns或是domin指向同一個IP但都是不同網站不同主機,這才是這篇文章的主題。
多網址指向同一IP,對應到區網內不同web server業界常常幹的事情。一個web server開給好幾個使用者或者好幾個網站,對應的都是同一IP,domin對應過去都是不同網站,虛擬主機都這樣幹。
Multiple Web Servers的功能就是把多網域指向同一IP不同server的功能
在ros裡設定也不難,但就是設定的時候要了解這個設定是幹啥用的。
要設定的東西有
1.web proxy
2.dns static
3.filewall nat
開啟你的web proxy
然後設定dns static 的domin到對應的IP
再來將filewall從80進來的轉到web proxy
就這樣....
走法會是這樣
AAA.com:80>>>>>>>>>>>>>>lan a server:80
BBB.com:80>web proxy:8080>lan b server:80
CCC.com:80>>>>>>>>>>>>>>lan c server:80
直接貼解法給你看
/ip web-proxy
set enabled=yes src-address=0.0.0.0 port=8080 hostname="你自己取" \
transparent-proxy=yes parent-proxy=0.0.0.0:0 \
cache-administrator="webmaster" max-object-size=4096KiB cache-drive=system \
max-cache-size=unlimited max-ram-cache-size=unlimited
/ip web-proxy access
add dst-port=23-25 action=deny comment="block telnet & spam e-mail relaying" \
disabled=no
add dst-port=80 action=allow comment="Enable Http Connection" disabled=no
/ip dns static add name=AAA.com address=192.168.88.2<區網IP>
/ip dns static add name=BBB.com address=192.168.88.3<區網IP>
/ip dns static add name=CCC.com address=192.168.88.4<區網IP>
/ip firewall nat
add chain=dstnat in-interface=outside dst-address=你的固定IP protocol=tcp \
dst-port=80 action=redirect to-ports=8080 comment="" disabled=no
tppr3695a wrote:
那麼關鍵不再router上,關鍵在你的httpd服務上nginx
NginX跟Apache都只是HTTPD,負責提供HTTP Service
.Server A, NginX, 192.168.0.10, port 80 (HTTP)
.Server B, Apache, 192.168.0.11, port 80 (HTTP)
.Server C, NginX, 192.168.0.12, port 80 (HTTP)
.Server D, Apache, 192.168.0.13, port 80 (HTTP)
Public IP: 1.32.25.137
FQDN/DDNS:透過RouterOS WEB Proxy可以這樣
.Any Client <-> http://www.ILoveTW.com/ <-> http://1.32.25.137/ <-> http://192.168.0.10/
.Any Client <-> http://www.ILoveCN.com/ <-> http://1.32.25.137/ <-> http://192.168.0.11/
.Any Client <-> http://www.ILoveHK.com/ <-> http://1.32.25.137/ <-> http://192.168.0.12/
.Any Client <-> http://www.ILoveJP.com/ <-> http://1.32.25.137/ <-> http://192.168.0.13/
SLB:透過RouterOS PCC可以這樣
.Client A <-> http://www.ILoveTW.com/ <-> http://1.32.25.137/ <-> http://192.168.0.10/
.Client B <-> http://www.ILoveTW.com/ <-> http://1.32.25.137/ <-> http://192.168.0.11/
.Client C <-> http://www.ILoveTW.com/ <-> http://1.32.25.137/ <-> http://192.168.0.12/
.Client D <-> http://www.ILoveTW.com/ <-> http://1.32.25.137/ <-> http://192.168.0.13/
連線轉發的工作是在Router完成的,關鍵是路由這一段,你可以:
Firewall <-> Router <-> SLB <-> Internal Server
也可以
RouterOS (Firewall <-> Router <-> SLB) <-> Internal Server
內文搜尋

X