All Products
Search
Document Center

Elastic Compute Service:IIS website access issues

Last Updated:Sep 07, 2026

Issue index

Resolve a "500 - Internal Server Error"

Cause

  • Hidden detailed errors: By default, IIS shows a generic "500 error" page to remote clients to avoid exposing sensitive server information, such as code paths or database connection strings.

  • Configuration or code defects: The root cause is often syntax errors in the web.config file or application code exceptions.

Solution

By enabling Detailed Errors for a site in IIS, the server will display the specific error reason and code line number directly in the browser, which helps you accurately locate the problem.

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Enable detailed errors.

    1. In the Connections pane on the left side of Internet Information Services (IIS) Manager, select the target website (such as www.xxx) to go to its home page.

    2. In the IIS section, double-click Error Pages.

    3. In the Actions area on the right side of the page, click Edit Feature Settings, select Detailed Errors, and click OK.

  4. Access the website to view the detailed error information.

    Press Ctrl + F5 to force a refresh. The browser will display detailed error information and specify the line in the configuration file (such as web.config) that contains the error. You can fix the corresponding configuration file or application code based on the detailed error message.

Block direct IP access in IIS

Blocking direct access to your website by IP address can prevent security risks caused by unregistered or malicious domain names resolving directly to your server's public IP address.

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Bind a domain name.

    In the left navigation bar of the Internet Information Services (IIS) Manager page, click the target website, and then click Bindings in the Actions column. In the Site Bindings window, double-click the record where the Hostname parameter is empty to open the Edit Site Binding window and enter the domain name.

  4. The configuration is successful if the website is accessible via its domain name but not the server's public IP address.

Resolve IIS port conflicts

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open Command Prompt as an administrator.

    Click Start, enter cmd, right-click Command Prompt, and select Run as administrator.

  3. Check whether the service port is in use.

    Get-NetTCPConnection -LocalPort <port>

    The response includes the port status State and the owning process OwningProcess.

    LocalAddress    LocalPort RemoteAddress    RemotePort State     AppliedSetting OwningProcess
    ------------    --------- -------------    ---------- -----     -------------- -------------
    ::              80        ::               0          Listen                   4
    The example above indicates that port 80 is occupied by the process whose ID is 4.
  4. Use the PID to find the specific application.

    Replace <PID> with the process ID displayed in the OwningProcess column in the previous step.

    Get-Process -Id <PID>
  5. Resolve the port conflict.

    • Stop the process that is using the port.

      If you confirm that the program that is using the port can be closed, you can use the taskkill command to forcibly terminate the process.

      taskkill /F /PID <PID>
    • Change the application port.

      To reduce application port conflicts, use a port within the registered port range (8000–49151).
      1. Click Start, select Server Manager, and in the top-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

      2. In the left navigation pane of the Internet Information Services (IIS) Manager page, click the target website, and then in the Actions pane, click Bindings.

      3. In the Site Bindings window, select an existing binding record, click Edit, modify the port, and click OK.

  6. Restart IIS.

    iisreset /noforce
  7. Access the website to verify that it is accessible.

Resolve a "403.14 - Forbidden" error

Cause

  • Missing Default Document: A default entry file (such as index.html or default.aspx) is not configured in the website's root directory or the accessed subdirectory.

  • Directory browsing disabled: For security, IIS prohibits listing directory contents by default. This setting triggers a 403.14 error when a default document is not found.

Solution

Option 1: Configure a default document

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Configure the default document.

    1. In Internet Information Services (IIS) Manager, click the target website, and in the IIS section, double-click Default Document and click Enable.

    2. In the Default Document list, add the entry file names for your website, such as index.html or default.htm. Ensure that the specified default document file exists in the physical root directory of your website.

  4. Access the website again to verify that it is accessible.

Option 2: Enable directory browsing

Important

Enabling directory browsing exposes your site's file and directory structure, which poses a security risk.

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Enable directory browsing.

    1. On the Internet Information Services (IIS) Manager page, in the left navigation bar, click the target website.

    2. In the IIS section, double-click Directory Browsing, and in the Actions pane on the right, click Enable.

  4. Access the website again to verify that it is accessible.

Resolve a "0x80070002" error

Cause

IIS relies on Handler Mappings to determine how to process requests for specific file types, such as .aspx files. If the .NET Framework is installed in the wrong order, or if its registration information in IIS is damaged or missing, IIS cannot find the correct component to handle ASP.NET requests. This causes a "file not found" error.

Solution

The solution is to use the aspnet_regiis.exe tool to re-register the correct .NET Framework version with IIS. This repairs the damaged handler mappings.

  1. Click Start, enter cmd, right-click Command Prompt, and select Run as administrator.

  2. Navigate to the Framework directory.

    The aspnet_regiis.exe tool is located in the .NET Framework installation directory.

    It is usually located in the C:\Windows\Microsoft.NET\Framework64 directory. Take .NET Framework 4.x as an example:

    cd /d C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  3. Uninstall ASP.NET.

    aspnet_regiis.exe -u
  4. Install and register ASP.NET with IIS.

    aspnet_regiis.exe -i
  5. Restart IIS.

    iisreset /noforce
  6. Access the website to verify that it is accessible.

Resolve a "534 Policy requires SSL" error

Cause

The FTP client is configured to use FTP over TLS (FTPS), but the corresponding IIS FTP site is not configured to allow SSL connections. As a result, the server rejects the SSL/TLS handshake request from the client.

Solution

Check and enable the SSL connection policy for the target FTP site in IIS to ensure it matches the client's security connection requirements.

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Configure the FTP site SSL policy.

    1. Click the target FTP site and double-click FTP SSL Settings in the FTP area on the home page.

    2. In the FTP SSL Settings area, set SSL Policy to Allow SSL connections, and then in the Actions window, click Apply.

  4. Connect to the FTP site to verify that it is accessible.

Resolve a "Bad Request - Invalid Hostname" error

Cause

The IIS server received an HTTP request but could not find a configured site that matches the hostname in the request header for one of the following reasons:

  • Hostname not bound: The target website does not have a binding added in IIS for the accessed domain name.

  • Incorrect binding information: The website has a hostname bound, but it contains a spelling error or is bound to the wrong IP address or port.

  • Binding conflict: The domain name is already bound to another site in IIS, causing a request routing conflict.

Solution

Check and correctly configure the website bindings for the target site to ensure that the access domain name matches the site configuration.

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Check and configure website bindings.

    1. In the left navigation pane of the Internet Information Services (IIS) Manager page, click the target website, and then click Bindings in the Actions pane.

    2. On the Site Binding page, bind a domain name or check that the information for the bound domain name is correct.

      • Add a new domain name.

        1. On the Site Binding page, click Add.

        2. On the Add Site Binding page, set the domain name in the Hostname field and click OK.

      • View or modify a bound domain name.

        1. On the Site Binding page, double-click the existing binding record.

        2. On the Edit Website binding page, view the binding information.

          To modify the domain name, edit the Hostname and then click OK.

  4. Access the website to verify that it is accessible.

Resolve a "500.19" error

Cause

The ApplicationHost.config or Web.config file contains a malformed or unrecognized XML element.

ApplicationHost.config is the server's root configuration file and defines global defaults and server-level settings.
Web.config files provide application-level configuration and are used to override or extend settings inherited from upper levels.

Solution

  1. Log on to an ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.

    2. Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.

  2. Open IIS Manager.

    1. Click Start and select Server Manager.

    2. In the upper-right corner of the Server Manager page, select Tools > Internet Information Services (IIS) Manager.

  3. Check the web.config file.

    1. In the left-side navigation pane of the Internet Information Services (IIS) Manager page, click the target website, and then click Browse in the Actions area to go to the site directory.

    2. Open the web.config configuration file in the site directory, and refer to the IIS Configuration Reference to check and fix it.

  4. Check the ApplicationHost.config file.

    Go to the C:\Windows\System32\inetsrv\config\ folder, open the ApplicationHost.config configuration file, and refer to ApplicationHost.config configuration to check and fix the file.

  5. Open Command Prompt and restart IIS.

    iisreset /noforce
  6. Access the website to verify that it is accessible.