'Authentication 502 Bad Gateway nginx

I'm trying to install simple login selfhosted. But when I get to the registration part I get stuck.

I do not receive the email. Please see the error of nginx:

2022/05/14 12:59:40 [error] 3129#3129: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 12.34.56.789, server: simplelogin.mydomain.com, request: "GET / HTTP/1.1", upstream: "http://[::1]:7777/", host: "simplelogin.mydomain.com" 2022/05/14 13:00:12 [error] 3129#3129: *46 connect() failed (111: Connection refused) while connecting to upstream, client: 3.223.52.167, server: simplelogin.mydomain.com, request: "GET / HTTP/1.1", upstream: "http://[::1]:7777/", host: "simplelogin.mydomain.com" 2022/05/14 13:00:38 [error] 3129#3129: *10 connect() failed (111: Connection refused) while connecting to upstream, client: 12.34.56.789, server: simplelogin.mydomain.com, request: "GET /auth/resend_activation HTTP/1.1", upstream: "http://[::1]:7777/auth/resend_activation", host: "simplelogin.mydomain.com" 2022/05/14 13:01:00 [error] 3129#3129: *10 upstream prematurely closed connection while reading response header from upstream, client: 12.34.56.789, server: simplelogin.mydomain.com, request: "POST /auth/resend_activation HTTP/1.1", upstream: "http://127.0.0.1:7777/auth/resend_activation", host: "simplelogin.mydomain.com" 2022/05/14 13:01:00 [error] 3129#3129: *10 connect() failed (111: Connection refused) while connecting to upstream, client: 12.34.56.789, server: simplelogin.mydomain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://[::1]:7777/favicon.ico", host: "simplelogin.mydomain.com", referrer: "https://simplelogin.mydomain.com/auth/resend_activation" 2022/05/14 13:01:00 [error] 3129#3129: *10 no live upstreams while connecting to upstream, client: 12.34.56.789, server: simplelogin.mydomain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://localhost/favicon.ico", host: "simplelogin.mydomain.com", referrer: "https://simplelogin.mydomain.com/auth/resend_activation" 2022/05/14 13:01:47 [error] 3129#3129: *59 connect() failed (111: Connection refused) while connecting to upstream, client: 155.146.37.46, server: simplelogin.mydomain.com, request: "GET /static/node_modules/font-awesome/css/font-awesome.css HTTP/1.1", upstream: "http://[::1]:7777/static/node_modules/font-awesome/css/font-awesome.css", host: "simplelogin.mydomain.com"

I changed the /etc/nginx/sites-enabled/simplelogin

It was

server {
    server_name  app.mydomain.com;

    location / {
        proxy_pass http://localhost:7777;
    }
}

But I got the same error only with the mention of localhost. So changed it to

server {
    server_name  app.mydomain.com;

    location / {
        proxy_pass http://127.0.0.1:7777;
    }
}

Still same issue. Port 7777/tcp is open



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source