Answer the question
In order to leave comments, you need to log in
How to solve 502 Bad Gateway nginx?
Hello.
Installed ghost cms according to documentation on VPS.
It started, there are no errors in the logs.
When accessing the domain, it gives 502.
2021/01/16 09:16:18 [error] 397571#397571: *545 connect() failed (111: Connection refused) while connecting to upstream, client: 185.163.27.157, server: children-planet.ru, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:2369/", host: "blog.children-planet.ru"
2021/01/16 09:16:18 [error] 397571#397571: *545 connect() failed (111: Connection refused) while connecting to upstream, client: 185.163.27.157, server: children-planet.ru, request: "GET /favicon.ico HTTP/2.0", upstream: "http://127.0.0.1:2369/favicon.ico", host: "blog.children-planet.ru", referrer: "https://blog.children-planet.ru/"
server {
listen 80;
listen [::]:80;
server_name blog.children-planet.ru;
root /var/www/blog.children-planet.ru/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
}
Answer the question
In order to leave comments, you need to log in
As I thought, the problem was that I removed and reinstalled nginx.
Cleaned up all garbage and restarted nginx and ghost cms
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question