PAC文件& IIS - 将不需要的HTTPS URL重定向到错误页面

时间:2017-09-30 21:52:31

标签: iis https proxy pac

我正在尝试将不需要的HTTPS网址重定向到代理并显示自定义错误页面。

首先,我的pac文件是由端口80绑定到客户端的IIS10网站提供的。

其次,在我的pac文件中,我使用dnsDomainIs检查一些URL,如果域匹配则直接在Internet上。

第三,在我的pac文件中,如果域名不匹配,则重定向到另一个端口上运行的另一个网站,以显示特定的网页。

我会说到目前为止一切都在运行,除非在客户端上我尝试查看https://www.google.com是否重定向到代理(网站)并且客户端浏览器显示自定义网页但是nada: - / < / p>

我的意思是,每次浏览与PAC中的网站不匹配的网站时,大局都会在客户端浏览器上显示自定义页面。

我在我的pac中使用了这些规则:

function FindProxyForURL(url, host) {

if (dnsDomainIs(host, "www.hp.com")) { return "DIRECT"; }

// every other http: URLs will redirect to the localhost:8080 to display an error page
if (url.substring(0,5)=="http:" ) { return "PROXY localhost:8080"; }

// below the rest like https should be redirected to the localhost:443
else { return "PROXY localhost:443"; }  

}

对于每个网址的网址都是https://onedrive.live.com/about/en-us/,似乎没有通过localhost重定向:443,客户端浏览器会显示与网址相关的网页,而不是我的自定义网页。

任何非常有帮助的帮助,我都没有想法,

非常感谢。

0 个答案:

没有答案
相关问题