Skip to content

Add a health check URL for AWS ELB ECS

Alex Agranov edited this page Feb 14, 2017 · 2 revisions

One of the common problems encountered when deploying under AWS ECS/ELB is allowing a Target Group health check to succeed - especially if we're forcing all HTTP traffic to HTTPS, causing an infinite redirect loop.

An Nginx solution is to add a server block configuration that listens on a path such as /elb-status, irrespective of the port that traffic arrives on.

Here is how we can add such a server block proxy-wide, such that it is evaluated before any VIRTUAL_HOST/port-specific settings:

RUN { \
      [ COPY TEMPLATE SETTINGS HERE ]
      echo ' '; \
      echo 'server {'; \
      echo '  location /elb-status {'; \
      echo '    access_log off;'; \
      echo '    return 200;'; \
      echo '  }'; \
      echo '}'; \
    } > /etc/nginx/proxy.conf

The [ COPY TEMPLATE SETTINGS HERE ] is a reminder to follow the instructions in the NOTE under "Replacing default proxy settings" in the Readme.

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy