Search code examples
nginxunicorncentos7

nginx unicorn load balancing issue


I have been following this Tutorial but I have run into an issue I am using nginx for load balancing and have it set up on server A and I have a unicorn rails application server running on server B but when I go to the ip address of server A it is not showing me my rails app as hoped but is showing me a Welcome to nginx on Fedora! page here is the ip so you can look: http://46.101.6.169/ both servers are running CentOS7 I will also post the nginx config as well.

http {

upstream unicorn_servers {
    server 10.131.222.114:8080 fail_timeout=0;
}

server {
    listen 80;

    location / {

        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_pass http://unicorn_servers;
    }

 }

This is my first time setting up a scalable server system.


Solution

  • I have found the answer all I needed to do was add server_name to nginx config file and the issue is now resolved.