Issue with Nginx Load Balancer

Hello Team,

I am working on the KodeKloud Engineer – Nginx Load Balancer task where we need to configure nginx on the LBR server and distribute traffic to the App Servers .

Task Summary:

  • Install nginx on the LBR server.
  • Configure load balancing using the http context for all App Servers.
  • Update only /etc/nginx/nginx.conf .
  • Do not modify the Apache port configured on the App Servers.

What I have done so far:

  1. Installed nginx on the LBR server.
  2. Updated /etc/nginx/nginx.conf with the following configuration:
upstream app_servers {
    server stapp01:5001;
    server stapp02:5001;
    server stapp03:5001;
}

server {
    listen 80;

    location / {
        proxy_pass http://app_servers;
        
![lbr_5|690x387](upload://kirpNJzmZaM0AGcpumexv3eRziF.png)
![lbr_6|690x387](upload://p4LRr4klz9GxQpj0JjmbB0XLjDh.png)
![lbr_7|690x387](upload://5VfFCbuCPhKq3HhKJLldmX6eiPu.png)

    }
}
  1. Verified nginx configuration:
nginx -t

Output:

syntax is ok
test is successful
  1. Restarted nginx:
systemctl restart nginx
  1. Verified backend servers are reachable:
curl stapp01:5001

Output:

Welcome to xFusionCorp Industries!

However, when I access the StaticApp URL , I still see the CentOS HTTP Server Test Page instead of the expected application output.

It seems the request is not being properly forwarded to the backend servers even though nginx syntax validation is successful.

Could someone please guide me on what I might be missing in the nginx configuration?

Thank you in advance.


Hi @Pranav8

Please refer to the solution here https://github.com/imShakil/100-Days-Of-DevOps-Challenge-KodeKloud/blob/main/days/016.md

Hi Ramond,

you gave me the below link containing the answers of my query . But this is not opening :

I opened the link twice in the past 24 hours but I could not spend time fix nginx Load Balancer configuration issue . Pls look in to it .

Regards,

This is new – it looks like Microsoft is rate-limiting non-logged in Github page hits.

Do you have a Github account? It’s free and if you’re doing devops, you really should have one anyway. Just register and do that; it should prevent this problem.

Yes, I also faced the “Too Many Requests” page today and had to wait a few seconds before accessing the page again. It is related to GitHub (Microsoft), not the KodeKloud platform.