I’m facing to a problem with Azure WordPress on App Service, the Startup Command is ignored when I perform a restart of App service. I need to copy a custom config file into nginx directory as described in the article Configure Nginx for PHP 8 Linux Azure App Service.
Here is the content of startup.sh script:
#!/bin/bash
cp /home/spec-settings.conf /etc/nginx/conf.d/spec-settings.conf
service nginx restart
Do someone have any idea what might be wrong?
3
Answers
To resolve the problem "Azure Linux Startup Command ignored" try below workarounds:
Workaround1:
To copy a custom config file into nginx directory use custom startup script.
According to the documentation you are following, you need to give the below command in startup command field:
Save the setting after changing the Startup Command. This makes the App service to restart.
Workaround2:
If you dont want to give startup command in that field, leave the existing value you entered and try below:
/home/site/startup.sh
Now, For the Startup Command enter
/home/site/startup.sh
, and save the setting and navigate your application.For more in detail, please refer below link:
NGINX Rewrite Rules for Azure App Service Linux PHP 8.x – (azureossd.github.io).
I tried all sort of StartUp Scripts and Start Up Commands but I then noticed that my Start Up Command was being ignored. I had a WordPress Web App Service and wanted to modify the nginx.conf as well. After a lot of hours restarting the App and editing containers I noticed that the App by default has a file located in
/home/dev/startup.sh
. I edited the file and inputted the below commands and after the next restart all worked on its own. I did not even need to input any start up command. This file is by default executed by the app on restart.Please also note that my nginx default config was located in
/etc/nginx/conf.d/default.conf
After setting up both
/home/dev/nginx.conf
and editing/home/dev/startup.sh
you can restart the app and test any of your rules.I also got this problem. In my case I created the startup script on a Windows computer which causes the problem. When I changed the format to Unix (e.g. with Notepad++), the startup script was executed.