nginx unicorn 负载均衡问题
nginx unicorn load balancing issue
我一直在关注这个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/
两台服务器都是 运行 CentOS7 我也会 post nginx 配置。
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;
}
}
这是我第一次设置可扩展的服务器系统。
我找到了答案,我需要做的就是将 server_name 添加到 nginx 配置文件,现在问题已解决。
我一直在关注这个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/ 两台服务器都是 运行 CentOS7 我也会 post nginx 配置。
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;
}
}
这是我第一次设置可扩展的服务器系统。
我找到了答案,我需要做的就是将 server_name 添加到 nginx 配置文件,现在问题已解决。