配置IIS反向代理教程

Alan

Alan

Maintainer of blog

假设将域名www.helloworld.com代理到本地的8080端口

准备工作#

设置#

设置前:

files/iis-reverse-proxy/IIS-Proxy-Tutorial-0.png

开启ARR代理:

files/iis-reverse-proxy/IIS-Proxy-Tutorial-1.pngfiles/iis-reverse-proxy/IIS-Proxy-Tutorial-2.pngfiles/iis-reverse-proxy/IIS-Proxy-Tutorial-3.png

新建一个站点helloworld(站点名称随意), 并绑定域名www.helloworld.com:

files/iis-reverse-proxy/IIS-Proxy-Tutorial-4.png

配置helloworld站点的URL Rewrite:

files/iis-reverse-proxy/IIS-Proxy-Tutorial-5.pngfiles/iis-reverse-proxy/IIS-Proxy-Tutorial-6.pngfiles/iis-reverse-proxy/IIS-Proxy-Tutorial-7.pngfiles/iis-reverse-proxy/IIS-Proxy-Tutorial-8.png

配置完成之后访问 www.helloworld.com 实际上访问的是IIS的站点helloworld, 然后IIS会将请求路由到127.0.0.1:8080, 看到的效果如下:

files/iis-reverse-proxy/IIS-Proxy-Tutorial-9.png