0

I'm working on the deployment of the app with the backend and frontend using Nginx as a proxy. However I'm facing the 502 Bad Gateway, the error says

[error]: connect() failed (111: Connection refused) while connecting to upstream, client: 218.232.234.171, server: hms.kict.re.kr, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.25.0.2:32000/favicon.ico", host: "hms.kict.re.kr", referrer: "https://hms.kict.re.kr/"

I've never faced this error before so still stuck with it.

Here is my nginx.conf file


server {
  listen 31000;

  sendfile on;

  default_type application/octet-stream;

  keepalive_timeout 65;
  gzip on;
  gzip_http_version 1.1;
  gzip_disable      "MSIE [1-6]\.";
  gzip_min_length   256;
  gzip_vary         on;
  gzip_proxied      expired no-cache no-store private auth;
  gzip_types        text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  gzip_comp_level   9;

  location /api/ {
    proxy_pass http://dev-api:3000;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_redirect off;
    client_max_body_size 1g;
  }

  location / {
    proxy_pass http://dev-web:80;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_redirect off;
    client_max_body_size 1g;
  }
}


frankiie
  • 101
  • 1
  • Your configuration has no upstream with port 32000. Please add output of `nginx -T` to the question so we can see the actual configuration that is used. – Tero Kilkanen Jul 28 '22 at 21:42

0 Answers0