Bonjour tout le monde,

Je suis embêté depuis quelques jours sur mon site. Tout fonctionnait correctement et lors de lecture de fichiers log de nginx et autre j'ai une erreur 502 qui s'affiche et donc plus d'accès à mon site. Mon installation :

- Un site en Flask python avec une gestion de DB mysql
- j'ai Nginx, supervisor, gunicorn et certbot pour le https d'installer

Mes logs nginx (en partie):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
2022/10/23 13:34:01 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
2022/10/23 13:34:02 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
2022/10/23 13:34:03 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
2022/10/23 13:34:04 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
2022/10/23 13:34:05 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
2022/10/23 13:34:06 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
2022/10/23 13:34:24 [error] 3053#3053: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.monsite.com"
2022/10/23 13:34:24 [error] 3053#3053: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://[::1]:8000/", host: "www.monsite.com"
2022/10/23 13:34:26 [error] 3053#3053: *1 no live upstreams while connecting to upstream, client: 197.214.3.222, server: www.monsite.com, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "www.monsite.com"
Mon fichier nginx.conf:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	client_max_body_size 5M;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

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

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}


#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
# 
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}
Mon fichier conf dans le dossier nginx/sites-enabled :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
server {
	server_name www.monsite.com;

	location /static {
		alias /home/fred/monsite/shop/static;
	}

	location / {
		proxy_pass http://localhost:8000;
		include /etc/nginx/proxy_params;
		proxy_redirect off;
	}

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/www.monsite.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.monsite.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

server {
    if ($host = www.monsite.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name www.monsite.com;
    return 404; # managed by Certbot
}
Le status de nginx :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-10-23 13:55:19 UTC; 28min ago
       Docs: man:nginx(8)
    Process: 5301 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 5313 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 5314 (nginx)
      Tasks: 2 (limit: 1066)
     Memory: 3.9M
     CGroup: /system.slice/nginx.service
             ├─5314 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             └─5315 nginx: worker process
mon lsb_release -a :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.5 LTS
Release:	20.04
Codename:	focal
J'ai essayer :

- redémarrer le serveur
- redémarrer nginx et supervisor (sudo systemctl restart ****)
- renouveller le certificat certbot

Mes compétences en gestion de serveur sont limitées donc là je ne vois pas quoi faire d'autre, j'espère juste que quelqu'un puisse m'aider avant que je réinitialise tout... ce qui m'embêterais beaucoup

Merci d'avance pour votre aide.

Fred.