WordPress Linux on Azure marketplace doesn’t working

Right after the installation the server always returns the error 502 Bad Gateway – nginx

This is the log

2021-01-07T01:01:29 Welcome, you are now connected to log-streaming service.
Starting Log Tail -n 10 of existing logs —-
/home/LogFiles/__lastCheckTime.txt (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/__lastCheckTime.txt)01/06/2021 21:29:48

/home/LogFiles/kudu/trace/2433a5b487bc-d26ae6de-22d3-4080-9a9e-885bc7f3eaee.txt (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/2433a5b487bc-d26ae6de-22d3-4080-9a9e-885bc7f3eaee.txt)
2021-01-06T21:30:57 Startup Request, url: /api/vfs/site/wwwroot/?_=1609967296424, method: GET, type: request, pid: 178,1,15, ScmType: None

/home/LogFiles/kudu/trace/4484297e20b6-99d3ec14-a894-45a7-9d99-6789a1c31c38.txt (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/4484297e20b6-99d3ec14-a894-45a7-9d99-6789a1c31c38.txt)
2021-01-06T22:29:27 Startup Request, url: /api/logs/docker, method: GET, type: request, pid: 146,1,20, ScmType: None

/home/LogFiles/kudu/trace/b3942923d997-f2525b2e-0c42-47d6-90b2-8fe719a0deee.txt (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/b3942923d997-f2525b2e-0c42-47d6-90b2-8fe719a0deee.txt)
2021-01-07T00:03:08 Startup Request, url: /api/vfs/site/wwwroot/?_=1609976744818, method: GET, type: request, pid: 161,1,4, ScmType: None

/home/LogFiles/kudu/trace/bc4bb9da0ee8-b3949a1c-59f5-440b-ac4a-3aec3a89b4d9.txt (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/bc4bb9da0ee8-b3949a1c-59f5-440b-ac4a-3aec3a89b4d9.txt)
2021-01-06T23:58:13 Startup Request, url: /api/vfs/site/wwwroot/?_=1609976744815, method: GET, type: request, pid: 127,1,16, ScmType: None

/home/LogFiles/2021_01_06_lw0sdlwk00002A_default_docker.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/2021_01_06_lw0sdlwk00002A_default_docker.log)
2021-01-06T23:58:51.619267660Z 2021-01-06 23:58:51,509 INFO spawned: ‘nginx’ with pid 119
2021-01-06T23:58:51.804316173Z 2021-01-06 23:58:51,794 INFO spawned: ‘sshd’ with pid 120
2021-01-06T23:58:51.993869394Z 2021-01-06 23:58:51,959 INFO spawned: ‘watch-fpm-socket’ with pid 121
2021-01-06T23:58:52.532445506Z 2021-01-06 23:58:52,530 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-06T23:58:52.590188703Z 2021-01-06 23:58:52,580 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-06T23:58:52.678840153Z 2021-01-06 23:58:52,677 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-06T23:58:52.979378062Z 2021-01-06 23:58:52,976 INFO success: watch-fpm-socket entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-06T23:59:07.114135546Z 2021-01-06 23:59:07,113 INFO exited: sshd (exit status 0; expected)

/home/LogFiles/2021_01_06_lw0sdlwk00002A_docker.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/2021_01_06_lw0sdlwk00002A_docker.log)
2021-01-06T23:50:13.805Z INFO – Pulling image from Docker hub: http://mcr.microsoft.com/appsvc/wordpress-alpine-php:0.72
2021-01-06T23:50:17.115Z INFO – 0.72 Pulling from appsvc/wordpress-alpine-php
2021-01-06T23:50:17.366Z INFO – Digest: sha256:093ddec5b61ed66e8642da89928b611454cc57f091a0d7c3d9e10835c16d5896
2021-01-06T23:50:17.368Z INFO – Status: Image is up to date for http://mcr.microsoft.com/appsvc/wordpress-alpine-php:0.72
2021-01-06T23:50:18.012Z INFO – Pull Image successful, Time taken: 0 Minutes and 3 Seconds
2021-01-06T23:50:18.457Z INFO – Starting container for site
2021-01-06T23:50:18.458Z INFO – docker run -d -p 8184:80 –name refritec_4_aa081bdf -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=true -e WEBSITE_SITE_NAME=refritec -e WEBSITE_AUTH_ENABLED=False -e PORT=80 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=http://refritec.azurewebsites.net -e WEBSITE_INSTANCE_ID=27a8387a29d0e883736126cb444aced9b0c7daa310ed6e78e304c09e4cac392e -e HTTP_LOGGING_ENABLED=1 http://mcr.microsoft.com/appsvc/wordpress-alpine-php:0.72
2021-01-06T23:50:39.855Z INFO – Initiating warmup request to container refritec_4_aa081bdf for site refritec
2021-01-06T23:50:49.864Z INFO – Container refritec_4_aa081bdf for site refritec initialized successfully and is ready to serve requests.

/home/LogFiles/2021_01_07_lw0sdlwk00002A_default_docker.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/2021_01_07_lw0sdlwk00002A_default_docker.log)
2021-01-07T00:00:24.019623691Z 2021-01-07 00:00:23,992 INFO spawned: ‘php-fpm’ with pid 118
2021-01-07T00:00:24.183214889Z 2021-01-07 00:00:24,145 INFO spawned: ‘nginx’ with pid 119
2021-01-07T00:00:24.214397508Z 2021-01-07 00:00:24,212 INFO spawned: ‘sshd’ with pid 120
2021-01-07T00:00:24.309606065Z 2021-01-07 00:00:24,263 INFO spawned: ‘watch-fpm-socket’ with pid 121
2021-01-07T00:00:24.965113958Z 2021-01-07 00:00:24,956 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07T00:00:25.423051506Z 2021-01-07 00:00:25,421 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07T00:00:25.452002856Z 2021-01-07 00:00:25,423 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07T00:00:25.460312670Z 2021-01-07 00:00:25,452 INFO success: watch-fpm-socket entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07T00:00:32.937405640Z 2021-01-07 00:00:32,928 INFO exited: sshd (exit status 0; expected)

/home/LogFiles/nginx/access.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/nginx/access.log)

/home/LogFiles/nginx/error.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/nginx/error.log)2021/01/06 21:33:12 [error] 163#163: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET /robots933456.txt HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “127.0.0.1:7038″2021/01/06 21:33:12 [error] 163#163: *3 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “http://refritec.azurewebsites.net”, referrer: “h t t p : / /portal.azure.com”2021/01/06 22:21:24 [error] 141#141: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET /robots933456.txt HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “127.0.0.1:1392″2021/01/06 22:21:24 [crit] 141#141: *3 connect() to unix:/var/run/php/php7.0-fpm.sock failed (13: Permission denied) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “http://refritec.azurewebsites.net”, referrer: “h t t p : / /portal.azure.com”2021/01/06 23:50:10 [error] 141#141: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET /robots933456.txt HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “127.0.0.1:4836″2021/01/06 23:50:49 [error] 141#141: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET /robots933456.txt HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “127.0.0.1:8184″2021/01/06 23:50:49 [error] 141#141: *3 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET /install HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “http://refritec.azurewebsites.net”2021/01/06 23:58:52 [error] 141#141: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET /robots933456.txt HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “127.0.0.1:3981″2021/01/06 23:58:53 [error] 141#141: *3 connect() to unix:/var/run/php/php7.0-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 172.16.4.1, server: _, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “http://refritec.azurewebsites.net”

/home/LogFiles/nginx/php-error.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/nginx/php-error.log)

/home/LogFiles/supervisor/supervisord.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/supervisor/supervisord.log)
2021-01-07 00:00:22,853 INFO supervisord started with pid 116
2021-01-07 00:00:23,992 INFO spawned: ‘php-fpm’ with pid 118
2021-01-07 00:00:24,145 INFO spawned: ‘nginx’ with pid 119
2021-01-07 00:00:24,212 INFO spawned: ‘sshd’ with pid 120
2021-01-07 00:00:24,263 INFO spawned: ‘watch-fpm-socket’ with pid 121
2021-01-07 00:00:24,956 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07 00:00:25,421 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07 00:00:25,423 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07 00:00:25,452 INFO success: watch-fpm-socket entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-07 00:00:32,928 INFO exited: sshd (exit status 0; expected)

/home/LogFiles/webssh/pm2.log (h t t p : / /refritec.scm.azurewebsites.net/api/vfs/LogFiles/webssh/pm2.log)

Ending Log Tail of existing logs —
Starting Live Log Stream —

Answer

Azure confirmed it is a bug on East region. The solution to this problem was just use the East2 region.

Attribution
Source : Link , Question Author : Fernando Magno , Answer Author : Fernando Magno

Leave a Comment