
问:<?xml version=\”1.0\” encoding=\”UTF-8\”?>
<configuration> <system.webServer> <rewrite> <rules><rule name=\”WWW Redirect0\”><match url=\”^(.*)\” /><conditions><add input=\”{HTTP_HOST}\” pattern=\”^www.xxx.com$\” /></conditions><action type=\”Rewrite\” url=\”http://127.0.0.1:8888/{R:0}\” redirectType=\”Permanent\” /></rule> </rules> </rewrite> </system.webServer></configuration>
我想购买一个内网主机,在我公司测试这种代码能实现HTTP代理,要实现HTTPS代理,web.config如何配置用https://www.xxx.com
访问https://127.0.0.1:8888/
,如何配置HTTPS代理解析
答:您好,
1.从您的描述来看请问是否是指的访问www.xxx.com 然后去获取到http://127.0.0.1:8888/ 的数据?如果是,那么这个是反向代理,但是得确保服务器内可以正常请求127.0.0.1,反向代理您可以网上搜索“nginx配置反向代理”2.如果您不是这个意思,请详细说明下业务需求,最终想实现什么样的效果,非常感谢您长期对我司的支持!
问:是反向代理,我目前是IIS,在我公司测试这种代码能实现HTTP代理,要实现HTTPS代理,web.config如何配置,网上搜索没找到资料
答:您好,抱歉iis反向代理不太了解,您上面规则是301重定向跳转到http://127.0.0.1:8888/,您可以用以下规则试下能否实现,反向代理建议您网上搜索“nginx配置反向代理”通过nginx配置,非常感谢您长期对我司的支持!
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=\"301\" stopProcessing=\"true\">
<match url=\"^(.*)$\" ignoreCase=\"false\" />
<conditions logicalGrouping=\"MatchAll\">
<add input=\"{HTTPS}\" pattern=\"^on$\" negate=\"true\" />
</conditions>
<action type=\"Redirect\" url=\"https://www.abc.com/{R:1}\" redirectType=\"Permanent\" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>


