0

So, I'm using this library, https://github.com/nginx-proxy/nginx-proxy/#usage, which works as expected when starting my application with virtual host in my aws instances, but load balancer is looking for a /health to know that the instance is healthy.

Howevery, I cannot find a way to integrate this to my nginx configuration following the documentation. I have tried several ways. The most logical thing to me was creating a Dockerfile like this:

FROM nginxproxy/nginx-proxy
RUN { \
    echo 'server {'; \
    echo '  location /health {'; \
    echo '      access_log off;'; \
    echo '      return 200;'; \
    echo '  }'; \
    echo '}'; \
    } > /etc/nginx/conf.d/my_proxy.conf

While my_proxy.conf is there, the configuration doesn't take effect, I've also tried appending to default.conf, but it gets reconstructed.

No matter what I try I keep getting 503 response:

nginx.1     | 172.30.0.11 172.30.2.137 - - [28/Mar/2023:02:04:42 +0000] "GET /health HTTP/1.1" 503 190 "-" "ELB-HealthChecker/2.0" "-"

I just want to responde code 200 to ELB-HealthChecker when it does the /health, I also have an endpoint in my application for /health, but as it comes without domain, it doesn't redirect to it.

Anyone knows how to achieve this?

Lauro182
  • 1,597
  • 3
  • 15
  • 41
  • I just gave up on this approach, and just created a docker image from nginx, and overwrote default.conf with Dockerfile. But maybe someone knows his way around nginx proxy library. – Lauro182 Mar 29 '23 at 02:08

0 Answers0