App Service WordPress (WP): can I add rules via SSH/another terminal to Nginx server to make a WP plugin work?

Stephen Wartel 60 Reputation points
2023-06-12T12:44:17.24+00:00

Using Azure App Service for WordPress (WP) site. Need to add WP plugin which requires uploading rule changes to this WP App Service's Azure Nginx server. Can this be done by me using the SSH terminal or another terminal in the Azure App Service's portal or would any rule changes like this need to be made by an Microsoft Azure support engineer?

Thank you in advance for any help, information, suggestions.

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
0 comments No comments
{count} votes

Accepted answer
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-06-12T15:59:07.4333333+00:00

    as you can see from the link

    https://stackoverflow.com/questions/63126908/modifying-nginx-conf-for-azure-app-linux-service

    In Azure App Service, there are two perspectives on modifying the Nginx configuration via SSH or another terminal

    You can potentially modify your Nginx configuration via the startup command of your app service. The steps to do this are:

    • SSH into your app service :)
    • Copy over the default Nginx configuration file to your home directory
    cp /etc/nginx/sites-available/default /home/site/nginx.conf.
    
    • Modify the copied-over Nginx configuration file at /home/site/nginx.conf
    • Create a bash file /home/site/startup.sh with the following contents:
    cp /home/site/nginx.conf /etc/nginx/sites-available/default
    service nginx reload
    

    Set your app service startup command to /home/site/startup.sh.

    During startup, your app service will overwrite the default Nginx configuration and reload the Nginx service. While this method works, it is not the most maintainable solution​.

    There are limitations within the Azure sandbox. You can't modify the nginx.conf as you're inside a Microsoft docker container. Any files or directories outside of the /home directory will not persist between site recycles. As such, you might not have access to change certain settings since they are locked down under the Azure sandbox​.

    1 person found this answer helpful.

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.