简体   繁体   中英

After deploying the react application on azure getting error

I deployed the react application on azure with windows environment. After accessing the website getting the following error "You do not have permission to view this directory or page."

I added the web.config file inside the root still getting the same error.

web.config file code

<?xml version="1.0"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="React Routes" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

When encountering an error message, first we can view the log. There are many ways to specifically it. You can view the Application Event Logs in the Diagnose and solve problems in the web app.

Troubleshooting steps:

  1. First of all, confirm what code file changes were made before the error message occurred. This may be the cause of the exception.

  2. Check the running log of the existing program. It is recommended to check relevant documents or blog articles for learning.

  3. If you ensure that the above steps are normal, it is recommended that after ensuring that the program runs normally locally, the code is continuously deployed through git , and the release status is checked in Action.

(Because of your current error message, I probably took a look, it should be a deployment failure)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM