1

I setup an NGINX loadbalancer in front of 2 tomcat servers on a Cent7 system. When I try to pull them up from the LB, I just get the default index.html NGINX page from the default installation. I've gone through a bunch of guides but im not sure what im failing on. I created a load-balancer.conf file in the /etc/nginx/conf.d/ folder and it looks like this:

upstream backend {
  server 192.168.80.123; 
  server 192.168.80.122;
}

server {
   listen 80; 

location / {
  proxy_pass http://backend;
   }
}

The nginx.conf files is default right now. I followed some guides that had a setup similar to apache with sites-available, but got the same results. Seems like im missing something somewhere, but I can't find where. No matter what I try it just pulls up the default index.html file that is in /usr/share/nginx/html.

2 Answers 2

1

Use nginx -T to test you configuration, and more importantly, view the actual configuration that nginx is using.

Start from /etc/nginx/nginx.conf as all other files are included from there.

1
  • Combed back through all of the .conf and made a couple changes. I deleted my original load-balancer.conf file and recreated a default.conf file. This time i added in 'server_name tomcat-test.com' below listen port, restarted the services and it started working properly.
    – saleetzo
    Commented May 9, 2017 at 21:06
0

I ended up deleting my load-balancer.conf file in the /etc/nginx/conf.d/ folder and created a default.conf file. I added

server_name tomcat-test.com;

after the listen port in the .conf and restarted service. Now, its all working.

1
  • Yeah i didnt need help with the "main job" -- just needed help with the actual question I listed. Thanks for the reply tho but kindof unnecessary.
    – saleetzo
    Commented May 10, 2017 at 22:05

You must log in to answer this question.

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