Monthly Archives: November 2022

Azure App Service (linux, Nginx), PHP 8.x, 1MB upload problem (WordPress, client_max_body_size)

Azure App Service for Linux platform now supports PHP 7 and PHP 8 built-in docker image. 

The issue is that PHP 7.x runs on Apache web server and PHP 8.x run on Nginx server where you cannot server variables via .htaccess

Nginx main configuration is kept in Niginx server{} config we need to change this config and reload Nginx.

We need to copy /etc/nginx/sites-enabled/default to the /home folder. /home folder is fixed in an Azure Storage file share, files stored there will stay there after restart and will be shared across scale instances

Go to:

Go to App Service WEBSSH via https://<AppServiceName>.scm.azurewebsites.net/webssh/host or via UI:

Copy file:

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

Edit file:

nano /home/default

Change App Service startup setup to:

cp /home/default /etc/nginx/sites-enabled/default; service nginx restart

in the same file we can change other Nginx settings.