Назад | Перейти на главную страницу

Ошибка 502 Bad Gateway с Cloudflare и сервером DigitalOcean с регистратором Name.com. Мой сайт не работает

В эти часы я внес некоторые изменения в конфигурации. Сайт по-прежнему не работает.

Моя текущая конфигурация:

Кроме того, если я перейду к настройке домена в cloudflare, он говорит, что мой домен не находится в cloudflare: https://ibb.co/1nKy37m

В этом нет никакого смысла ... Cloudflare говорит, что все в порядке, но затем он сообщает мне, что мой домен не находится в Cloudflare ..

Если я dig мой домен, возвращенные IP-адреса являются облачными, так что все должно быть в порядке.

Это последние строки журнала ошибок nginx:

....
....
....
2020/05/01 12:43:41 [crit] 503#503: *115 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 162.158.111.11, server: MYSITEDOMAIN, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "MYSITEDOMAIN", referrer: "https://MYSITEDOMAIN/"
2020/05/01 12:44:05 [crit] 503#503: *117 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 162.158.111.197, server: MYSITEDOMAIN, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "www.MYSITEDOMAIN"
2020/05/01 12:44:23 [crit] 503#503: *120 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 162.158.111.11, server: MYSITEDOMAIN, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "MYSITEDOMAIN"
2020/05/01 12:52:24 [crit] 503#503: *126 connect() to unix:/run/php/php7.3-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 141.101.77.36, server: MYSITEDOMAIN, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "MYSITEDOMAIN", referrer: "https://MYSITEDOMAIN/"

Это последние строки nginx access.log (большинство IP-адресов, запрашивающих мой сайт, являются IP-адресами cloudflare):

....
....
....
....
    162.158.111.11 - - [01/May/2020:12:43:41 +0200] "GET / HTTP/1.1" 502 559 "https://MYSITEDOMAIN/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"
    162.158.111.197 - - [01/May/2020:12:44:05 +0200] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"
    141.101.77.102 - - [01/May/2020:12:44:07 +0200] "GET /favicon.ico HTTP/1.1" 404 187 "https://www.MYSITEDOMAIN/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"
    162.158.111.11 - - [01/May/2020:12:44:23 +0200] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"
    162.243.142.103 - - [01/May/2020:12:45:21 +0200] "GET /owa/auth/logon.aspx?url=https%3a%2f%2f1%2fecp%2f HTTP/1.1" 444 0 "-" "Mozilla/5.0 zgrab/0.x"
    173.19.158.0 - - [01/May/2020:12:50:23 +0200] "POST /spywall/timeConfig.php HTTP/1.1" 400 157 "-" "XTC"
    128.14.133.58 - - [01/May/2020:12:51:50 +0200] "GET / HTTP/1.1" 444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"
    141.101.77.36 - - [01/May/2020:12:52:24 +0200] "GET / HTTP/1.1" 502 559 "https://MYSITEDOMAIN/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"
    162.158.111.11 - - [01/May/2020:13:03:54 +0200] "GET / HTTP/1.1" 502 559 "https://MYSITEDOMAIN/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"
    162.158.111.11 - - [01/May/2020:13:07:18 +0200] "GET / HTTP/1.1" 502 559 "https://MYSITEDOMAIN/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36"

Это tcpdump -ni any port 53 | tee dns_problem.log если это полезно:

....
....
....
....
....
    12:26:47.922039 IP MYSERVERIP.43021 > 67.207.67.2.53: 41678+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:26:47.922455 IP MYSERVERIP.33604 > 67.207.67.2.53: 19353+ A? ams3.sonar.digitalocean.com. (45)
    12:26:47.923078 IP 67.207.67.2.53 > MYSERVERIP.43021: 41678 0/1/0 (103)
    12:26:47.923117 IP 67.207.67.2.53 > MYSERVERIP.33604: 19353 1/0/0 A 5.101.110.176 (61)
    12:28:47.929858 IP MYSERVERIP.43753 > 67.207.67.2.53: 4233+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:28:47.929928 IP MYSERVERIP.48707 > 67.207.67.2.53: 7770+ A? ams3.sonar.digitalocean.com. (45)
    12:28:47.930668 IP 67.207.67.2.53 > MYSERVERIP.43753: 4233 0/1/0 (103)
    12:28:47.930669 IP 67.207.67.2.53 > MYSERVERIP.48707: 7770 1/0/0 A 5.101.110.176 (61)
    12:30:47.939407 IP MYSERVERIP.48328 > 67.207.67.2.53: 33836+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:30:47.939825 IP MYSERVERIP.39293 > 67.207.67.2.53: 31800+ A? ams3.sonar.digitalocean.com. (45)
    12:30:47.940367 IP 67.207.67.2.53 > MYSERVERIP.48328: 33836 0/1/0 (103)
    12:30:47.940369 IP 67.207.67.2.53 > MYSERVERIP.39293: 31800 1/0/0 A 5.101.110.176 (61)
    12:32:47.952780 IP MYSERVERIP.53280 > 67.207.67.2.53: 1097+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:32:47.953270 IP MYSERVERIP.57976 > 67.207.67.2.53: 23225+ A? ams3.sonar.digitalocean.com. (45)
    12:32:47.954310 IP 67.207.67.2.53 > MYSERVERIP.57976: 23225 1/0/0 A 5.101.110.176 (61)
    12:32:47.954350 IP 67.207.67.2.53 > MYSERVERIP.53280: 1097 0/1/0 (103)
    12:34:47.961587 IP MYSERVERIP.56467 > 67.207.67.2.53: 24275+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:34:47.961937 IP MYSERVERIP.53192 > 67.207.67.2.53: 29751+ A? ams3.sonar.digitalocean.com. (45)
    12:34:47.962325 IP 67.207.67.2.53 > MYSERVERIP.53192: 29751 1/0/0 A 5.101.110.176 (61)
    12:34:47.962327 IP 67.207.67.2.53 > MYSERVERIP.56467: 24275 0/1/0 (103)
    12:35:44.931067 IP 117.27.239.28.53 > MYSERVERIP.80: Flags [S], seq 146329379, win 5840, length 0
    12:35:44.931099 IP MYSERVERIP.80 > 117.27.239.28.53: Flags [S.], seq 3580976498, ack 146329380, win 64240, options [mss 1460], length 0
    12:35:45.168909 IP 117.27.239.28.53 > MYSERVERIP.80: Flags [R], seq 146329380, win 0, length 0
    12:36:47.971890 IP MYSERVERIP.57008 > 67.207.67.2.53: 50604+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:36:47.971968 IP MYSERVERIP.47664 > 67.207.67.2.53: 60090+ A? ams3.sonar.digitalocean.com. (45)
    12:36:47.972829 IP 67.207.67.2.53 > MYSERVERIP.47664: 60090 1/0/0 A 5.101.110.176 (61)
    12:36:47.972830 IP 67.207.67.2.53 > MYSERVERIP.57008: 50604 0/1/0 (103)
    12:38:47.980976 IP MYSERVERIP.42576 > 67.207.67.2.53: 39248+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:38:47.981358 IP MYSERVERIP.48422 > 67.207.67.2.53: 35677+ A? ams3.sonar.digitalocean.com. (45)
    12:38:47.981751 IP 67.207.67.2.53 > MYSERVERIP.42576: 39248 0/1/0 (103)
    12:38:47.981752 IP 67.207.67.2.53 > MYSERVERIP.48422: 35677 1/0/0 A 5.101.110.176 (61)
    12:40:47.994730 IP MYSERVERIP.59368 > 67.207.67.2.53: 1292+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:40:47.995310 IP MYSERVERIP.40757 > 67.207.67.2.53: 28794+ A? ams3.sonar.digitalocean.com. (45)
    12:40:47.995598 IP 67.207.67.2.53 > MYSERVERIP.59368: 1292 0/1/0 (103)
    12:40:47.995765 IP 67.207.67.2.53 > MYSERVERIP.40757: 28794 1/0/0 A 5.101.110.176 (61)
    12:42:48.003261 IP MYSERVERIP.33954 > 67.207.67.2.53: 16402+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:42:48.003593 IP MYSERVERIP.37054 > 67.207.67.2.53: 11556+ A? ams3.sonar.digitalocean.com. (45)
    12:42:48.003973 IP 67.207.67.2.53 > MYSERVERIP.33954: 16402 0/1/0 (103)
    12:42:48.003974 IP 67.207.67.2.53 > MYSERVERIP.37054: 11556 1/0/0 A 5.101.110.176 (61)
    12:44:48.014388 IP MYSERVERIP.43089 > 67.207.67.2.53: 54807+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:44:48.014787 IP MYSERVERIP.39228 > 67.207.67.2.53: 49774+ A? ams3.sonar.digitalocean.com. (45)
    12:44:48.015243 IP 67.207.67.2.53 > MYSERVERIP.39228: 49774 1/0/0 A 5.101.110.176 (61)
    12:44:48.015245 IP 67.207.67.2.53 > MYSERVERIP.43089: 54807 0/1/0 (103)
    12:46:48.021926 IP MYSERVERIP.48429 > 67.207.67.2.53: 21229+ AAAA? ams3.sonar.digitalocean.com. (45)
    12:46:48.021995 IP MYSERVERIP.52767 > 67.207.67.2.53: 38688+ A? ams3.sonar.digitalocean.com. (45)
    12:46:48.022608 IP 67.207.67.2.53 > MYSERVERIP.48429: 21229 0/1/0 (103)
    12:46:48.022769 IP 67.207.67.2.53 > MYSERVERIP.52767: 38688 1/0/0 A 5.101.110.176 (61)
    12:48:48.030531 IP MYSERVERIP.5607

Исправлено редактированием файла / etc / nginx / sites-available / default.

Был неправильный сокет php-fpm (более старая версия php-fpm, которая больше не установлена, так как я обновил версию php-fpm)