Logo 10Logo 10Logo 10Logo 10
  • HOME
  • BLOCKS
  • START
  • SUPPORT
    • Platform Status
    • Support Center
  • DEVELOPERS
  • Privacy Policy
  • Terms and Conditions
  • Terms of Service
  • Support Policy
English
MY ACCOUNT
✕
The taboo of failure in IT projects
December 13, 2021
AWS Amplify, different build settings for different branches.
August 20, 2022

AWS ALB Health Check for multiples app or services on NGINX

February 8, 2022

There are many reasons to deploy multiple apps or services on a NGINX AWS EC2 instance, from cost savings to redundancy. In our case, we have an Application Load Balancer handling all requests to a Target Group (or Server Farm). However, in those cases is not just straightforward to set up the targets health check.

This post presents a solution to that scenario.

Case

Our EC2 Instance has a default website on port 80 and 2 or more apps on port 80 but with different host headers (ie: aka.mydomain.com, afa.mydomain.com, etc), so when it is time to set up the Target Group Health Check we need a solution to how to monitor each service (or app) instead of the default NGINX site.

Solution

We ended up changing our default NGIX website (etc/nginx/sites-available/default) by including the following segment:

        location /aka {
                proxy_set_header Host aka.mydomain.com;
                proxy_pass http://127.0.0.1/health;                
        }

        location /afa {
                proxy_set_header Host afa.mydomain.com;
                proxy_pass http://127.0.0.1/health;
        }

Therefore, on each Target Group, we can use on the path of the Health Check “/aka” and in the other Target Group “/afa”. We are doing an NGINX redirect and adding the host header, the health route is a health check page on all our applications that returns 200 and some details of the status of our apps and services.

Now, Our EC2 instance running multiple NGINX apps or services can be a target on both Target Groups and the health check will do its job if one of the services is down sending requests to any other available targets.


Do you have an idea and want to make a prototype to see if it is functional or sustainable over time? Then, 23blocks is the best solution that you will find to carry out this development with less effort and investment.

Each of our blocks is a combination of Software, Infrastructure, and Services, which are available as API Microservices. According to industry standards, these are hosted in a highly available cloud, ready for production and use.

Making the decision to start a software project can be complicated and intimidating. So, contact us at info@23blocks.com to receive free assistance from our software experts and get started on your idea.

There is a better way to build apps and platforms —the #23blocksway.

Share

@2009-2023, 23blocks Inc. Powered By 23blocks

Company


About Us
Study Cases
Team
Partners
Investors

Features


Infrastructure
DevOps
Instrumentation
Telemetry
Exchange

Developers


FAQs
Languages
Frameworks
Tools
Blog

Made With Blocks & Boulder, CO   Privacy Policy | Terms & Conditions   Version 3.0 - Production
MY ACCOUNT
English
  • No translations available for this page