ELB health check fails if path is anything but root

0

I've got an Application ELB running in front of a Target Group that currently has only 1 instance, a web server (NGINX) running a WordPress site.

The ELB's health check fails with a 404 error unless I set the path to the web server's root directory ("/"). The ELB seems to be directing traffic fine--I can browse anywhere on the site no problem, including to a special file I created just for the health check (health-check.php).

I looked in my web server's access log to see what exactly is happening when the ELB health check tries to ping a file:

172.31.36.39 - - [12/Jul/2020:13:38:41 +0000] "GET /health-check.php HTTP/1.1" 404 134 "-" "ELB-HealthChecker/2.0"

But if I point the health checker to the root it works fine:

172.31.28.14 - - [12/Jul/2020:13:59:42 +0000] "GET / HTTP/1.1" 200 396 "-" "ELB-HealthChecker/2.0"

I'm going round and round in circles here trying to figure this out but can't seem to pinpoint the problem.

Any advice or help would be hugely appreciated.

Why does the server return a 404 code to the health checker but returns a 200 when I access the same exact file with my browser?

demandé il y a 4 ans4162 vues
2 réponses
0

I resolved this: the health checker apparently communicates to the server without using the domain name assigned to it and I had inadvertently left something in the NGINX config. that pointed any requests other than those with the domain name to a different root location. So the health checker wasn't actually looking in the right root directory. My mistake.

répondu il y a 4 ans
0

I figured it out...see my last post.

répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions