I updated the Nginx config on App service(linux), it suddenly not working. What should be the possible reason

marker.wong 0 Reputation points
2025-01-27T09:51:20.0333333+00:00

I have a App service (Linux) with a Laravel application. I updated the Nginx config in order to fulfill the Laravel needs with SSH. It keeps working fine. Yesterday the website suddenly not working. I find out it's the issue of nginx config. I reload the nginx config then it works again. No one can access the Azure portal so there should be no possibility that someone restart or change the server. Also I checked that's no activity or deployment log.

May I know is that any reason for the issue above. Is it a good practice to change the Nginx config with SSH? I also included a replace and reload script on the start script to make sure the Nginx config should be updated even any restart or deployment. This script is also working fine.

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

Accepted answer
  1. Shree Hima Bindu Maganti 3,125 Reputation points Microsoft Vendor
    2025-02-03T11:16:47.6366667+00:00

    Hi @marker.wong ,
    Thanks for the question and using MS Q&A platform.
    There are several potential reasons why your Nginx configuration for the Laravel application may have stopped working.

    • Syntax errors in the Nginx configuration file can prevent Nginx from starting or reloading correctly. Use sudo nginx -t to verify the syntax of the configuration files.
    • Direct changes to the Nginx configuration via SSH may not persist across restarts or deployments unless a mechanism is in place to reapply them. Including a replace and reload script in your start script is a good practice to ensure the configuration is updated.
    • Changes in firewall settings or network issues can block access to your application. Ensure necessary ports, such as port 80, are open.
    • If the Laravel application crashes or stops responding, Nginx cannot connect to it. Check the application logs for errors.
    • Resource limitations, such as memory or CPU, can cause the application or Nginx to become unresponsive.

    Modifying the Nginx configuration via SSH is generally acceptable, but it is essential to document changes and have a recovery plan in place. Using scripts to manage configurations helps maintain consistency.
    Configure a PHP app for Azure App Service (platform-linux)

    Host ASP.NET Core on Linux with Nginx
    If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.


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.