You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure网站绑定自定义域名后出现'/应用程序'运行时错误及web.config配置咨询

Troubleshooting Custom Domain Runtime Error on Azure App Service

First, let's confirm your web.config setup: your <customErrors mode="Off"/> configuration is correct for ASP.NET Framework apps, but there are a few other angles to check since you're still seeing the generic error page. Here's what to try next:

  • Verify Azure App Service's built-in error settings
    Azure sometimes overrides web.config configurations with its own portal settings. Head to your App Service in the Azure portal, navigate to Configuration > General settings, find the Error pages section, and set Custom errors to Off. This ensures detailed error details are exposed to remote visitors.

  • Check your custom domain binding & validation status
    Make sure your custom domain is fully validated in Azure (check the Custom domains blade for any warning icons). Confirm your DNS records (A or CNAME) are pointing to the correct App Service IP or default domain. If you're using SSL, double-check that the certificate is properly bound, hasn't expired, and you've selected the right SSL type (SNI or IP-based) for your setup. Mismatched SSL bindings are a frequent cause of this kind of runtime error.

  • Enable and review Azure's application logs
    Generic runtime errors often hide specific backend issues in logs. Go to Monitoring > Log stream in your App Service to view real-time error logs, or enable Application logging (Filesystem) under Monitoring > App Service logs and download the log files later. These logs will show the exact exception—like missing dependencies, permission issues, or routing problems—that's causing the failure.

  • Add httpErrors configuration to your web.config
    For IIS-hosted apps (which Azure App Service uses), the <system.webServer> section's httpErrors setting can override the <customErrors> rule. Add this block to your web.config to ensure detailed errors are displayed:

    <configuration>
      <!-- ... your existing configuration content ... -->
      <system.webServer>
        <httpErrors errorMode="Detailed" />
      </system.webServer>
    </configuration>
    
  • Test locally with hosts file (optional)
    If you can, modify your local hosts file to map your custom domain to your App Service's public IP. Then access the domain from your local browser—this helps rule out DNS or network-level issues that might be blocking detailed error visibility.

内容的提问来源于stack exchange,提问作者Nic Bowles

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 05:12:35