在IIS中开启WebDAV
- 安装“WebDAV 发布”
- 启用 WebDAV 并添加创作规则
- 添加创作规则
- “身份验证”开启“Windows 身份验证”
- "授权"账户
用C#开发的一个程序,在本地环境运行正常,但部署到服务器一直报错:请求被中止: 未能创建 SSL/TLS 安全通道。
先用常规方法:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;不行,再加这行:
ServicePointManager.ServerCertificateValidationCallback = delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
};也不行。
升级.net framework,还是不行。
服务器操作系统是2019,应该不至于是版本太低的原因。
最后找到这个软件:IISCrypto 执行后完美解决问题。
在IIS环境下部署前端应用时,可以使用以下Url重写规则:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="rule1">
<match url="^([\w\-\/]+)$" ignoreCase="true" />
<action type="Rewrite" url="index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration> 起因是想在服务器上安装SVN Server,选择的是SVN Server,这软件好像只支持http(s)协议,没有SVN协议,好吧,就不折腾了。在安装时选择端口号时又凌乱了,不想暴露那么多端口号,就打算用IIS的反射代理来实现。
这里记录一下设置IIS反向代理的操作步骤:
在网站中设置URL Rewrite:
<rule name="svn" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost:81/{R:1}" />
</rule>