0

This is the page appears when I call my webpage Error PageI configured two Nginx web server nodes with a Nignx load balancer.

192.168.0.100 - Nginx loadbalancer
192.168.0.101 - Nginx webserver1
192.168.0.102 - Nginx webserver2

If I call the website through my load balancer then its not working, Only showing the Default Nginx Page in my browser. But each web server is working fine, when i call them individually. This is my loadbalancer config.Do i need to make any change here..?

http {
    upstream website1 {
        server 192.168.0.101;
        server 192.168.0.102;
        }

server {
    listen 80; # Listen on the external interface
    server_name  192.168.0.100;

location / {
        proxy_pass  http://website1;
        }
    }
}
8
  • What url are you using to access the upstream servers directly for testing?
    – Drifter104
    Jun 3, 2016 at 10:05
  • 192.168.0.100
    – Cj Walter
    Jun 3, 2016 at 10:25
  • Sorry I mean are you just using the IP when testing the webserver directly. You put But each web server is working fine, when i call them individually - Are you just using the IP when calling them individually?
    – Drifter104
    Jun 3, 2016 at 10:39
  • Show configs of other servers
    – Alexey Ten
    Jun 3, 2016 at 13:54
  • @Drifter104 I am using the IP, I can also use the host name, I added entry in 'hosts' file in all three machines
    – Cj Walter
    Jun 4, 2016 at 6:08

1 Answer 1

0

Try taking the upstream out of http block and adding port the the upstream configuration:

upstream website1 {
    server 192.168.0.101:80;
    server 192.168.0.102:80;
    }

Also, do you have this configuration enabled? Should be in sites-enabled, or in some config, which gets included into live configuration.

1
  • upstream is not allowed outside http block
    – damuz91
    Jun 2, 2020 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .