首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法读取配置文件\\?\d:\home\site\.知名的\web.config

无法读取配置文件\\?\d:\home\site\.知名的\web.config
EN

Server Fault用户
提问于 2020-09-20 17:39:24
回答 1查看 873关注 0票数 0

我遇到了一种奇怪的情况:我在Azure上运行的一个ASP.NET核心网络应用程序存在从特定目录服务文件的问题。

具体来说,我试图从路径https://myurl.com/.well-known/acme-challenge/6uVkXzXxHHkm1d6cQiUqI07lrYspInk7i9WCKKl-RlQ提供一个文件,我注意到这是一个稍微不寻常的url,因为文件路径不包含文件扩展名,目录以(.)开头。这是我无法控制的要求。

不幸的是,虽然我可以在几乎所有的应用程序服务实例中成功地完成这个任务,但我有一个应用程序服务实例失败了,但有以下错误:

无法访问请求的页,因为该页的相关配置数据无效。配置错误无法读取配置文件\?\d:\home\ file .众所周知的\web.config

我的web.config看起来是这样的:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
   
    <modules>
      <!-- Remove WebDAV module so that we can make DELETE requests -->
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <!-- Remove WebDAV module so that we can make DELETE requests -->
      <remove name="WebDAV" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <!-- When deploying on Azure, make sure that "dotnet" is installed and the path to it is registered in the PATH environment variable or specify the full path to it -->
    <aspNetCore requestTimeout="23:00:00" processPath=".\Nop.Web.exe" arguments="" forwardWindowsAuthToken="false" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600" hostingModel="InProcess">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
        <environmentVariable name="COMPLUS_ForceENC" value="1" />
      </environmentVariables>
    </aspNetCore>
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
        <!-- Protects against XSS injections. ref.: https://www.veracode.com/blog/2014/03/guidelines-for-setting-security-headers/ -->
        <add name="X-XSS-Protection" value="1; mode=block" />
        <!-- Protects against Clickjacking attacks. ref.: http://stackoverflow.com/a/22105445/1233379 -->
        <add name="X-Frame-Options" value="SAMEORIGIN" />
        <!-- Protects against MIME-type confusion attack. ref.: https://www.veracode.com/blog/2014/03/guidelines-for-setting-security-headers/ -->
        <add name="X-Content-Type-Options" value="nosniff" />
        <!-- Protects against Clickjacking attacks. ref.: https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet -->
        <add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains" />
        <!-- CSP modern XSS directive-based defence, used since 2014. ref.: http://content-security-policy.com/ -->
        <add name="Content-Security-Policy" value="default-src 'self'; connect-src *; font-src * data:; frame-src *; img-src * data:; media-src *; object-src *; script-src * 'unsafe-inline' 'unsafe-eval'; style-src * 'unsafe-inline';" />
        <!-- Prevents from leaking referrer data over insecure connections. ref.: https://scotthelme.co.uk/a-new-security-header-referrer-policy/ -->
        <add name="Referrer-Policy" value="same-origin" />
        <!--Feature-Policy is a new header that allows a site to control which features and APIs can be used in the browser. ref.: https://wicg.github.io/feature-policy/ -->
        <add name="Feature-Policy" value="accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment *; usb 'none'" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>
<!--ProjectGuid: 4f1f649c-1020-45be-a487-f416d9297ff3-->

基于错误,它看起来像是出于某种原因,ASP.NET正在我的www.root目录中寻找一个web.config文件。有人能为我做错了什么提供指导吗?

EN

回答 1

Server Fault用户

发布于 2020-09-20 17:56:33

我几乎一发问题就能找到答案。

对于任何遇到这个问题的人来说,问题在于,不知何故,我将虚拟目录映射到此应用程序的路径中。

一旦我去掉了这个,一切都如期而至。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1034648

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档