0

I am new to Node.js and I have created a basic application in node.js and trying to deploy on Azure web App service.

After successful deployment, when I am trying to hit a website it showing me two types of error like You do not have permission to view this directory or page. or website not responding.

In both cases, when I tried to trace the logs, it shows me following logs in the things you can try

  1. If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
  2. Enable directory browsing using IIS Manager.
  3. Open IIS Manager.
  4. In the Features view, double-click Directory Browsing.
  5. On the Directory Browsing page, in the Actions pane, click Enable.
  6. Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

How can I resolve the error?

Dhruv
  • 3
  • 3

1 Answers1

0

You can try this approach:-

  • Create a web.config file at the root of the app directory.
  • Add the following code to web.config:

<configuration>
  <system.webServer>
    
    <!-- indicates that the index.js file is a node.js application 
    to be handled by the iisnode module -->
    
    <handlers>
      <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
    </handlers>
    
    <!-- adds index.js to the default document list to allow 
    URLs that only specify the application root location, 
    e.g. http://mysite.antarescloud.com/ -->
    
    <defaultDocument enabled="true">
      <files>
        <add value="index.js" />
      </files>
    </defaultDocument>
    
  </system.webServer>
</configuration>

Hope it helps. You can try enabling customerror=off to for troubleshooting exact error.For reference please follow: Azure website message "You do not have permission to view this directory or page.". What to do?

MV

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27