Azurewebsite django URL为另一个应用程序重写

Azurewebsite django URL为另一个应用程序重写,django,wordpress,azure,azure-web-app-service,Django,Wordpress,Azure,Azure Web App Service,我在Azurewebsites上安装了wordpress,它主要运行Django。我已在应用程序设置中将应用程序设置为/blog to/site/wwwroot/blog 但是web.config没有提供url www.example.com/blog,而是抛出404错误 这是web.config,您能建议如何禁用www.example.com/blog的重写吗 <?xml version="1.0"?> <configuration> <system.diag

我在Azurewebsites上安装了wordpress,它主要运行Django。我已在应用程序设置中将应用程序设置为/blog to/site/wwwroot/blog

但是web.config没有提供url www.example.com/blog,而是抛出404错误

这是web.config,您能建议如何禁用www.example.com/blog的重写吗

<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
          <filter type="" />
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <appSettings>
    <add key="WSGI_ALT_VIRTUALENV_HANDLER" value="django.core.wsgi.get_wsgi_application()" />
    <add key="WSGI_ALT_VIRTUALENV_ACTIVATE_THIS" value="D:\home\site\wwwroot\env\Scripts\python.exe" />
    <add key="WSGI_HANDLER" value="ptvs_virtualenv_proxy.get_venv_handler()" />
    <add key="PYTHONPATH" value="D:\home\site\wwwroot" />

    <!--
    <add key="WSGI_PTVSD_SECRET" value="" />
    -->
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <!-- Required for websockets. -->
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <remove name="Python340_via_FastCGI" />
      <add name="Python FastCGI" path="handler.fcgi" verb="*" modules="FastCgiModule" scriptProcessor="D:\Python34\python.exe|D:\Python34\Scripts\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
      <!-- Uncomment the following handler to enable remote debugging. -->
      <!--
      <add name="ptvsd" path="ptvsd" verb="*" resourceType="Unspecified" type="Microsoft.PythonTools.Debugger.WebSocketProxy, Microsoft.PythonTools.WebRole"/>
      -->
      <!-- <clear/>
      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
      -->
    </handlers>
    <rewrite>
      <rules>
        <!-- Uncomment the following rule to enable remote debugging. -->
        <!--
        <rule name="ptvsd" enabled="true" stopProcessing="true">
          <match url="^ptvsd(/.*)?$"/>
        </rule>
        -->
        <rule name="Static Files" stopProcessing="true">
          <conditions>
            <add input="true" pattern="false" />
          </conditions>
        </rule>
        <rule name="Configure Python" stopProcessing="true">
          <match url="(.*)" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="^/static/.*" ignoreCase="true" negate="true" />
          </conditions>
          <action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>
    <staticContent>
           <clientCache cacheControlMaxAge ="7.00:00:00" cacheControlMode="UseMaxAge" />
    </staticContent>
  </system.webServer>
</configuration>

根据您的描述,我建议您可以尝试在规则中添加不匹配条件

如果url的目标是blob文件夹,则不会重写它

更多详细信息,请参阅下面的配置

<rule name="Configure Python" stopProcessing="true">
  <match url="(.*)" ignoreCase="false" />
  <conditions>
    <add input="{REQUEST_URI}" pattern="^/static/.*" ignoreCase="true" negate="true" />
     <add input="{URL}" pattern="^/blog/.*" ignoreCase="true" negate="true" />
  </conditions>
  <action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />
</rule>


根据您的描述,我建议您可以尝试在规则中添加不匹配条件

如果url的目标是blob文件夹,则不会重写它

更多详细信息,请参阅下面的配置

<rule name="Configure Python" stopProcessing="true">
  <match url="(.*)" ignoreCase="false" />
  <conditions>
    <add input="{REQUEST_URI}" pattern="^/static/.*" ignoreCase="true" negate="true" />
     <add input="{URL}" pattern="^/blog/.*" ignoreCase="true" negate="true" />
  </conditions>
  <action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />
</rule>