【发布时间】:2019-04-19 06:21:23
【问题描述】:
我正在尝试配置 CentOS 7.3、Nginx 和 PHP 7.3,但我得到:
502 错误网关 nginx/1.10.3
这是 site.com.conf:
server {
listen 80;
server_name server IP;
root /var/www/site.com/public;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
如果我将静态 HTML 上传到公共目录,我可以看到它,但如果我尝试加载 PHP 文件,我会看到该错误。
我有/var/run/php-fpm/php-fpm.sock。
【问题讨论】: