Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By matzavinosg
I have deployed a rails 4 application as follows: Nginx, as a reverse proxy server Unicorn, rails server Now I want to add a second server, Faye, for messaging alongside with unicorn. How I can configure nginx to accept and route requests to faye too?
My nginx default.conf file is:
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/var/homes/HS/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /var/homes/HS/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
error_page 500 502 422 404 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
I know that I need to add a location /faye block to route the request. Something like:
location /faye {
proxy_pass http://127.0.0.1:9292;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_set_header X-Forwarded-Proto https;
break;
}
Do I have to add the 127.0.0.1:9292; in my upstream block??? Is this enough? because my app give a connection time out.