Upstream server error

Michiel nginx-forum at forum.nginx.org
Wed Oct 26 13:28:59 UTC 2016


Hi

I'm having issues with Google Endpoints and NGINX. 
I keep on getting the following error message:

2016/10/26 13:02:09 [error] 15802#0: *1 connect() failed (111: Connection
refused) while connecting to upstream, client: 78.20.209.87, server: ,
request: "GET /v1 HTTP/1.1", upstream: "http://127.0.0.1:8081/v1", host:
"104.199.29.197"

It seems like NGINX isn't listening to port 8081? 

Here's my configuration file (currently set up for testing):

user nginx;

worker_processes 1;
worker_rlimit_nofile 65535;

pid /run/nginx.pid;

error_log /var/log/nginx/error.log notice;

events {
    worker_connections 65535;
}

http {

    access_log  /dev/null;
    rewrite_log on;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    server_tokens       off;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    limit_req_zone  $binary_remote_addr zone=perip:10m rate=50r/s;
    limit_conn_zone $binary_remote_addr zone=peraddr:10m;

    server {

        listen       8081;
        server_name  _;
        root         /usr/share/nginx/api.puls.be;

        location / {
           return 200 '{status: "ok"}';
           add_header application/json;
        }

        error_page 403 404 500 502 503 504 /404.html;
        location = /404.html {
          root error;
        }

    }

}

Any idea's on how to catch requests to the upstream server?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,270568,270568#msg-270568



More information about the nginx mailing list