Nginx Configuration - Upstream - Backup Server
<p>I'm having a with my upstream, i'd like to know what's wrong with my nginx configuration:</p>

<pre><code>upstream backends {
server 127.0.0.1:80;
server 188.200.200.200 backup;
}

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html index.php;

    server_name localhost;

    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;
        proxy_read_timeout 150;
        proxy_pass http://backends;
        proxy_set_header Host $host;
        proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
 }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000


location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_read_timeout 150;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 4 256k;
            fastcgi_busy_buffers_size 256k;

    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
            deny all;
    }

 location ~* \.      (jpg|jpeg|gif|png|css|js|ico|xml|woff|ttf|otf|svg|woff2|eot)$ {
     access_log        off;
     log_not_found     off;
     expires           30d;
 }
</code></pre>

<p>It gives this message in the log:
connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"</p>

<p>Someone can help me?</p>

<p>Thanks in advance</p>