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
I have set up a nginx server several weeks ago, at that time http://180.76.117.109/1/#/home worked well.
However, when I recheck that today in a browser, it returns an 502 bad gateway error.
Here is the result of sudo tail -30 /var/log/nginx/error.log:
2018/03/26 10:13:12 [error] 9456#9456: *2580202 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /?season=1&league_id=1'%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))oUvL)%20AND%20'kSYX'='kSYX&match_day=1&team_id=1 HTTP/1.0", upstream: "http://127.0.0.1:3000/?season=1&league_id=1'%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))oUvL)%20AND%20'kSYX'='kSYX&match_day=1&team_id=1", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580204 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "POST /wp-admin/admin-ajax.php?action=duplicator_package_delete HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin-ajax.php?action=duplicator_package_delete", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580206 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date&order=asc HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date&order=asc", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580208 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.163, server: _, request: "GET /?action=data_management&cpmvc_do_action=mvparse&f=datafeed&method=remove&rruleType=del_only&calendarId=1%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))nDnr) HTTP/1.0", upstream: "http://127.0.0.1:3000/?action=data_management&cpmvc_do_action=mvparse&f=datafeed&method=remove&rruleType=del_only&calendarId=1%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))nDnr)", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580210 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin-ajax.php HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin-ajax.php", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580212 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin.php HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin.php", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580214 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "POST /wp-admin/admin-ajax.php?action=duplicator_package_delete HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin-ajax.php?action=duplicator_package_delete", host: "180.76.117.109:80"
2018/03/26 10:13:12 [error] 9456#9456: *2580216 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date%2c(select%20*%20from%20(select(sleep(5)))a)&order=asc HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date%2c(select%20*%20from%20(select(sleep(5)))a)&order=asc", host: "180.76.117.109:80"
2018/03/26 10:48:39 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 10:48:39 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 10:48:51 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 10:48:51 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 10:51:22 [error] 9456#9456: *2580223 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 10:51:22 [error] 9456#9456: *2580223 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:07:58 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:07:58 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:08:18 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:08:18 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:08:19 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:08:19 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:08:20 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:08:20 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:08:30 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:08:30 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
2018/03/26 11:08:31 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109"
2018/03/26 11:08:32 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/"
Does anyone know what may be the problem?
Check the upstream server, i.e. "http://180.76.117.109:3000/". It is very likely down.
I am trying to run Akka service using nginx. Here is my default.conf:
upstream hello-akka{
server localhost:9000;
}
server {
listen 9000;
location /* {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /akka {
proxy_pass http://hello-akka;
}
location /assets {
root /var/www;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Default nginx page works just fine but when I redirect to /akka I get 500 internal server error. Here is my nginx log file:
2017/12/05 10:58:17 [crit] 11077#11077: *1014 open() "/usr/share/nginx/html/50x.html" failed (24: Too many open files), client: 127.0.0.1, server: , request: "GET /akka HTTP/1.0", upstream: "http://127.0.0.1:9000/akka", host: "hello-akka"
I have changed /etc/security/limits.con file to increase the number of connections from 1024 to 16384. However, after that I keep getting another error:
host: "hello-akka"
2017/12/05 11:40:42 [error] 15916#15916: *37494 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /akka HTTP/1.0", upstream: "http://127.0.0.1:9000/akka"
So what is wrong with my configurations and how should I change them to run /akka page normally?
UPDATE: I have changed server localhost:9000 to server localhost:8080 in upstream hello-akka. However, when I redirect to localhost:9000/akka I get An error occurred page.
Error logs shows this error:
*1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /akka HTTP/1.1", upstream: "http://127.0.0.1:8080/akka", host: "localhost:9000"
How it should work
frontend start page is http://server/apex/ - dead page
redirect to work page, to /apex/f?p=100:4:0::NO:::
make clean url types http://server/apex/4/0/NO
location / {
proxy_pass http://127.0.0.1:8080;
include /etc/nginx/reverse_proxy.conf;
rewrite ^/$ /apex/f?p=100:4:0::NO:::? permanent;
}
location /apex {
proxy_pass http://127.0.0.1:8080;
include /etc/nginx/reverse_proxy.conf;
if ($args ~ "p=100:(.*):(.*)::(.*):::") {
set $args $1/$2/$3/$4;
rewrite ^/[a-z]+/.+ /apex/$args?;
}
}
log from nginx - access.log
"
GET / HTTP/1.1" 301 178 "-"
"GET /apex/f?p=100:4:0::NO::: HTTP/1.1" 404 5
from error log (debug)
[notice] 27639#0: *3 "^/$" matches "/", client: 222.222.222.222, server: server, request: "GET / HTTP/1.1", host: "server"
[notice] 27639#0: *3 rewritten redirect: "/apex/f?p=100:4:0::NO:::", client: 222.222.222.222, server: server, request: "GET / HTTP/1.1", host: "server"
[notice] 27639#0: *3 "p=100:(.*):(.*)::(.*):::" matches "p=100:4:0::NO:::", client: 222.222.222.222, server: server, request: "GET /apex/f?p=100:4:0::NO::: HTTP/1.1", host: "server"
[notice] 27639#0: *3 "^/[a-z]+/.+" matches "/apex/f", client: 222.222.222.222, server: server, request: "GET /apex/f?p=100:4:0::NO::: HTTP/1.1", host: "server"
[notice] 27639#0: *3 rewritten data: "/apex/4/0/NO", args: "", client: 222.222.222.222, server: server, request: "GET /apex/f?p=100:4:0::NO::: HTTP/1.1", host: "server"
[notice] 27639#0: *3 "p=100:(.*):(.*)::(.*):::" does not match "", client: 222.222.222.222, server: server, request: "GET /apex/f?p=100:4:0::NO::: HTTP/1.1", host: "server"
What am I doing wrong?
The site runs with nginx and an uwsgi (flask app) and shellinabox terminal.
After every 20 or 30 minutes, the shellinabox terminal is not getting loaded and the nginx log shows this -
2012/05/26 14:20:27 [error] 4547#0: *117 readv() failed (104: Connection reset by peer) while reading upstream, client: 192.168.122.128, server: _, request: "POST /login/ HTTP/1.1", upstream: "uwsgi://127.0.0.1:1973", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/login/"
2012/05/26 14:20:31 [crit] 4547#0: *105 mkdir() "/var/lib/nginx/tmp/proxy/3/00" failed (13: Permission denied) while reading upstream, client: 192.168.122.128, server: _, request: "GET /terminal/proxy/ShellInABox.js HTTP/1.1", upstream: "http://127.0.0.1:4200/ShellInABox.js", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/proxy/index/"
2012/05/26 14:21:06 [error] 4547#0: *103 upstream timed out (110: Connection timed out) while reading response header from upstream
, client: 192.168.122.128, server: _, request: "POST /terminal/proxy/? HTTP/1.1", upstream: "http://127.0.0.1:4200/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/proxy/index/"
2012/05/26 14:21:06 [error] 4547#0: *103 open() "/var/www/MYwebapp/templates/50x.html" failed (13: Permission denied), client: 192.168.122.128, server: _, request: "POST /terminal/proxy/? HTTP/1.1", upstream: "http://127.0.0.1:4200/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/proxy/index/"
2012/05/26 14:22:31 [error] 4547#0: *136 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.122.128, server: _, request: "GET /terminal/proxy/index/ HTTP/1.1", upstream: "http://127.0.0.1:4200/index/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/"
2012/05/26 14:22:31 [error] 4547#0: *136 open() "/var/www/MYwebapp/templates/50x.html" failed (13: Permission denied), client: 192.168.122.128, server: _, request: "GET /terminal/proxy/index/ HTTP/1.1", upstream: "http://127.0.0.1:4200/index/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/"
I tried to put sometime-out values ... nothing helped so far.
As I'm pretty much new to nginx/uwsgi/shellinabox, I'm currently stuck with this.
Here is my nginx.conf file -
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/MYwebapp_access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location /terminal/proxy {
rewrite ^/terminal/proxy/(.*)$ /$1 break;
proxy_pass http://localhost:4200/index;
proxy_set_header X-Real-IP $remote_addr;
#proxy_read_timeout 3000;
uwsgi_connect_timeout 6000;
uwsgi_read_timeout 6000;
uwsgi_send_timeout 6000;
}
location / { try_files $uri #MYwebapp; }
location #MYwebapp {
include uwsgi_params;
uwsgi_pass localhost:1973;
uwsgi_connect_timeout 6000;
uwsgi_read_timeout 6000;
uwsgi_send_timeout 6000;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/MYwebapp/templates;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/MYwebapp/templates;
}
}
# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
2012/05/26 14:21:06 [error] 4547#0: *103 upstream timed out (110: Connection timed out) while reading response header from upstream
, client: 192.168.122.128, server: _, request: "POST /terminal/proxy/? HTTP/1.1", upstream: "http://127.0.0.1:4200/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/proxy/index/"
2012/05/26 14:21:06 [error] 4547#0: *103 open() "/var/www/MYwebapp/templates/50x.html" failed (13: Permission denied), client: 192.168.122.128, server: _, request: "POST /terminal/proxy/? HTTP/1.1", upstream: "http://127.0.0.1:4200/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/proxy/index/"
2012/05/26 14:22:31 [error] 4547#0: *136 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.122.128, server: _, request: "GET /terminal/proxy/index/ HTTP/1.1", upstream: "http://127.0.0.1:4200/index/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/"
2012/05/26 14:22:31 [error] 4547#0: *136 open() "/var/www/MYwebapp/templates/50x.html" failed (13: Permission denied), client: 192.168.122.128, server: _, request: "GET /terminal/proxy/index/ HTTP/1.1", upstream: "http://127.0.0.1:4200/index/", host: "www.MYwebapp.org", referrer: "http://www.MYwebapp.org/terminal/"