mardi 7 juillet 2020

*1539 768 worker_connections are not enough while connecting to upstream

Deployed ruby backend api project to digitalocean server, i'm having issues configuring nagix and passenger when I make this api call "https://ift.tt/3ffOMmE" using postman i get this error based on cat /var/log/nginx/error.log

2020/07/08 02:59:11 [alert] 2769#2769: *1539 768 worker_connections are not enough while 
connecting to upstream, client: 159.65.65.203, server: borroup.com, request: "GET 
/api/v1/items HTTP/1.0", upstream: "http://159.65.65.203:80/api/v1/items", host: 
"159.65.65.203"

when i visit http://159.65.65.203/ i get this error

404 Not Found 
nginx/1.18.0

using Ubuntu 16.04.6 (LTS) x64 ruby 2.4.1

here is sudo nano /etc/nginx/sites-available/default

upstream app {
     server 159.65.65.203:80 fail_timeout=0;
}
# Default server configuration
server {
listen 80;
server_name borroup.com;
allow 159.65.65.203;
# this is where my react-app is located
root /var/www/development/ram/public/;
index index.html index.htm;

# Serve the static content (React app)
location / {
     try_files $uri /index.html =404;
 }

location /api {
     # Insert your public app path
     root /your/rails-app/path/public;
     proxy_pass http://app;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header Host $http_host;
     proxy_redirect off;
 }

 error_page 500 502 503 504 /500.html;
 client_max_body_size 4G;
 keepalive_timeout 10;
 }

here is sudo nano /etc/nginx/nginx.conf

 user deploy;
 worker_processes auto;
 pid /run/nginx.pid;

 events {
    worker_connections 768;
 }

 http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;
    access_log /var/log/nginx/access.log;
    gzip on;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

here is netstat -plunta

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program 
name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2769/nginx: 
worker
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -
tcp        0    976 159.65.65.203:22        222.186.30.167:11710    ESTABLISHED -
tcp        0      0 159.65.65.203:22        70.176.141.88:54472     ESTABLISHED -
tcp        0    604 159.65.65.203:22        184.101.50.220:55467    ESTABLISHED -
tcp6       0      0 :::22                   :::*                    LISTEN      -
udp        0      0 127.0.0.1:37075         127.0.0.1:37075         ESTABLISHED -

every time i change port i get similar but different wording errors

Note: This is a backend project does not have front end just used for api's

Aucun commentaire:

Enregistrer un commentaire