【发布时间】:2020-12-08 16:00:05
【问题描述】:
我的 nginx 配置有问题,我不知道我做错了什么,但我的服务器给出了 502 bad gateway 我正在添加配置
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name 188.166.254.137;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
请告诉我我哪里做错了
【问题讨论】:
-
你检查过 php-fpm 正在运行吗?套接字存在吗?
-
php-fpm 正在运行,它的状态是活动流量 0 请求/发送
标签: nginx nginx-reverse-proxy nginx-config