Web app - NGINX configuration resets to default

Nuno Vicente 40 Reputation points
2023-06-16T13:14:30.58+00:00

From time to time NGINX is loosing all configurations and resets to default. I'm making the configurations through the SSH terminal.

cp /home/default /etc/nginx/sites-available/default

All goes well for a couple of days and then it goes back to default. Any reason why?

Thanks in advance.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-06-19T14:42:51.8566667+00:00

    @Nuno Vicente Thanks for reaching here! If I have understood right you want to create your own customized Nginx configuration based on the default one. Please double check on the below steps to be followed.

    1. Copy the default Nginx configuration file located at /etc/nginx/sites-enabled/default to the /home folder.
    2. Since /home files are persisted in Azure Storage, ensure that your custom Nginx configuration file is saved under /home to survive restarts and be shared across instances.
    3. Access the App Service WEBSSH via https://<AppServiceName>.scm.azurewebsites.net/webssh/host.
    4. Modify the Nginx configuration by making changes to the /home/default file.
    5. Use a custom startup script to overwrite the original Nginx configuration file, allowing the platform to use your customized configuration each time the App Service starts.
    6. In the App Service Portal, navigate to "Configuration" -> "General settings" and add the following command in the "Startup Command" field and save the setting. cp /home/default /etc/nginx/sites-enabled/default; service.

    User's image

    For more details- see- Configure Nginx for PHP 8 Linux Azure App Service

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.