Wordpress in Containers - getting 502 when loading some images

Viewed 668

I have Wordpress deployed in Azure AppService with containers (Azure Container registry is used) the image used is from the docker hub -> wordpress:latest I also have --settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=TRUE enabled so my files are persisted in the VM

I have noticed that images are not displayed

I see a 502 error - https://{website}.azurewebsites.net/wp-includes/images/spinner-2x.gif I have checked with KUDU and the image is there

Could anyone point me into the right direction to fix this issue?

I have followed steps from this tutorial: https://docs.microsoft.com/en-us/azure/app-service/tutorial-multi-container-app

2 Answers

I opened a support ticket with Azure who said this is a known issue. The current workaround is to disable the following apache settings in the apache2.conf file:

EnableMMAP Off
EnableSendfile Off

If you're using Azure's base PHP image from mcr.microsoft.com/appsvc/php, they've built in these apache settings in their 7.4-apache_20210422.1 version (and presumably any later versions). See https://mcr.microsoft.com/v2/appsvc/php/tags/list to list image versions.

Setting WEBSITES_ENABLE_APP_SERVICE_STORAGE=TRUE enable persistent shared storage. You then need to use the WEBAPP_STORAGE_HOME environment variable that points to /home in your folder paths and volumes.

${WEBAPP_STORAGE_HOME}/site/wwwroot:/var/www/html

Documentation

Related