我在哪里可以获得所有默认IIS HTTP处理程序的列表?我需要文件!! 我已经阅读了一些博客,建议删除数十个未使用的HTTP处理程序,以提高性能和安全性.
例如,建议删除TraceHandler-Integrated和TraceHandler-Integrated-4.0,否则导航到/trace.axd会导致500内部服务器错误而不是404 Not Found,并且您不应该在生产环境中进行跟踪.
GitHub项目(现已删除)建议从您的站点删除的一些HTTP处理程序:
<system.webServer>
<handlers>
<remove name="TraceHandler-Integrated-4.0" />
<remove name="TraceHandler-Integrated" />
<remove name="AssemblyResourceLoader-Integrated-4.0" />
<remove name="AssemblyResourceLoader-Integrated" />
<remove name="WebAdminHandler-Integrated-4.0" />
<remove name="WebAdminHandler-Integrated" />
<remove name="HttpRemotingHandlerFactory-soap-ISAPI-2.0-64" />
<remove name="svc-ISAPI-4.0_32bit" />
<remove name="ScriptHandlerFactoryAppServices-Integrated-4.0" />
<remove name="ScriptResourceIntegrated-4.0" />
<remove name="svc-ISAPI-4.0_64bit" />
<remove name="svc-Integrated-4.0" />
<remove name="vbhtm-ISAPI-4.0_32bit" />
<remove name="vbhtm-ISAPI-4.0_64bit" />
<remove name="vbhtm-Integrated-4.0" />
<remove name="vbhtml-ISAPI-4.0_32bit" />
<remove name="vbhtml-ISAPI-4.0_64bit" />
<remove name="vbhtml-Integrated-4.0" />
<remove name="xamlx-ISAPI-4.0_32bit" />
<remove name="xamlx-ISAPI-4.0_64bit" />
<remove name="xamlx-Integrated-4.0" />
<remove name="xoml-ISAPI-4.0_32bit" />
<remove …Run Code Online (Sandbox Code Playgroud) 我想在我的功能测试项目中使用IHostingEnvironment和ConfigurationBuilder,因此根据环境,功能测试使用不同的配置集运行.我想使用下面的代码:
public IConfigurationRoot ConfigureConfiguration(IHostingEnvironment hostingEnvironment)
{
var builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{hostingEnvironment.EnvironmentName}.json", true)
.AddEnvironmentVariables();
return builder.Build();
}
Run Code Online (Sandbox Code Playgroud)
我希望有一个appSettings.json和appSettings.Production.json文件来指出我的功能测试在生产中.这可能吗?如何实现?我需要一个实例IHostingEnvironment.
我的理解是,设置Service类型以LoadBalancer创建新的Azure负载均衡器并为其分配IP地址Service.这是否意味着我可以使用端口80拥有多个服务?如果我的Service(一个ASP.NET核心应用程序)后面的应用程序可以处理TLS和HTTPS,为什么我不应该只使用LoadBalancer's Service我想要暴露给互联网?
使用Ingressif有什么好处我不关心TLS终止(你可以让Cloudflare处理TLS终止)?如果有的话,它会通过为每个请求添加额外的跃点来减慢速度.
下面的一些答案提到创建负载平衡器的成本很高.应该注意的是,Azure上的负载均衡器是免费的,但是他们会为IP地址收取费用,他们会免费为您提供5个IP地址.因此,对于您希望公开最多五个IP地址的小型项目,它基本上是免费的.除此之外,你可能想看看广告Ingress.
如果您不使用,一些答案也会提到额外的复杂性Ingress.我已经提到Cloudflare可以为我处理TLS终止.我还发现了external-dnsKubernetes项目在Cloudflare中创建指向负载均衡器IP地址的DNS条目?在我看来,切割Ingress降低了复杂性,因为我不得不配置和管理.Ingress的选择也是巨大的,我可能会选择一个错误的选项,这会在一段时间后无法维护.
azure kubernetes azure-kubernetes kubernetes-ingress azure-aks
我有一个ASP MVC 3网站,它有一个反馈表,应该要求SSL.
现在,我在名为"ContactUs"的控制器中有一个名为Feedback的操作,负责查看和处理反馈.
当我[RequireHttps]在该操作上使用该属性时,它运行良好,并将URL更改为"https".但是,我注意到我页面中的所有链接现在都指向"https"!好像这个属性迫使路由引擎将相同的内容应用到所有链接!
当然,只有这个单一动作才需要SSL,其余所有动作都需要正常的http.
谁能告诉我如何解决这个问题?
我一直在使用GitHub上Azure Active Directory的证书示例查看守护程序应用程序中的Azure AD官方身份验证.Web API服务似乎不了解客户端.
public IEnumerable Get()
{
//
// The Scope claim tells you what permissions the client application has in the service.
// In this case we look for a scope value of user_impersonation, or full access to the service as the user.
//
Claim scopeClaim = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/scope");
if (scopeClaim != null)
{
if (scopeClaim.Value != "user_impersonation")
{
throw new HttpResponseException(new HttpResponseMessage { StatusCode = HttpStatusCode.Unauthorized, ReasonPhrase … 我有一个运行状况检查端点/status返回以下状态代码和响应正文:
200 OK?503 Service UnnavailableHTTP状态代码对于降级响应应该是什么?"降级"检查用于成功但速度缓慢或不稳定的检查.什么HTTP状态代码最有意义?
http health-monitoring http-status-codes http-status-code-503 kubernetes-health-check
Kubernetes附带一个ConfigMap名为coredns可以让你指定的DNS设置。我想通过添加以下内容来修改或修补此配置的一小部分:
apiVersion: v1
kind: ConfigMap
data:
upstreamNameservers: |
["1.1.1.1", "1.0.0.1"]
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用kubectrl edit来编辑coredns ConfigMap上面的文件,该文件仅包含我要插入或更新的设置,并且可以将其合并到现有文件之上或在现有文件上打补丁ConfigMap吗?
原因是我希望使用CI / CD可重复进行部署。因此,即使我在全新的Kubernetes集群上运行了Helm图表,也将应用上面的设置。
我已经阅读了Git 文档,该文档表明我可以明确地将某些文件设置为文本,因此它们的行尾会自动更改或作为二进制文件以确保它们不变。
但是,我也读到 Git 非常擅长检测二进制文件,这让我觉得这不是必需的。所以我的问题是我真的需要为存储库中的每个文件扩展名指定这些显式设置吗?我已经看到一些建议为所有图像文件扩展名这样做。
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
Run Code Online (Sandbox Code Playgroud) 我想使用 运行我的 API dotnet run,所以我可以针对它运行一些测试。但是,在 Azure Pipelines 和 AppVeyor 上,它们没有安装开发人员证书,当我尝试启动 API 时出现错误。安装开发人员证书涉及运行:
dotnet dev-certs https --trust
Run Code Online (Sandbox Code Playgroud)
但是,这会显示一个用户必须单击的对话框,这将导致构建失败。如何在 CI 服务器上安装开发者证书?
.net certificate dotnet-cli azure-pipelines dotnet-dev-certs
.net ×2
azure ×2
kubernetes ×2
actionlink ×1
asp.net ×1
asp.net-core ×1
asp.net-mvc ×1
azure-aks ×1
c# ×1
certificate ×1
configmap ×1
coredns ×1
dotnet-cli ×1
git ×1
graphql ×1
http ×1
httphandler ×1
hyperlink ×1
iis ×1
lf ×1
neo4j ×1
newline ×1
patch ×1
performance ×1
requirehttps ×1
security ×1