NGINX 服务器上的 502 错误 运行 Magento APP 的 HHVM
502 error on NGINX server running with HHVM for a Magento APP
我正在尝试在 AWS EC2 服务器上安装 Magento 运行 NGINX 和 HHVM。
我在浏览器中打开 Magento 时收到 502 网关错误。在我的 /var/log/nginx/error.log 中我有这个错误:
2015/06/19 13:40:34 [crit] 1976#0: *4 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 62.77.173.61, server: qa.magento.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "qa.magento.dev"
由此我认为 NGINX 正在寻找 php5-fpm 而不是 HHVM。知道我该如何解决这个问题吗?
我可以通过使用
更新我的 nginx 配置文件来解决这个问题
# Handle the exectution of .php files.
location ~ .php$ {
if (!-e $request_filename) {
rewrite / /index.php last;
}
expires off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
try_files $uri $uri/ @handler;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_param HTTPS $fastcgi_https;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params;
}
我正在尝试在 AWS EC2 服务器上安装 Magento 运行 NGINX 和 HHVM。
我在浏览器中打开 Magento 时收到 502 网关错误。在我的 /var/log/nginx/error.log 中我有这个错误:
2015/06/19 13:40:34 [crit] 1976#0: *4 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 62.77.173.61, server: qa.magento.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "qa.magento.dev"
由此我认为 NGINX 正在寻找 php5-fpm 而不是 HHVM。知道我该如何解决这个问题吗?
我可以通过使用
更新我的 nginx 配置文件来解决这个问题# Handle the exectution of .php files.
location ~ .php$ {
if (!-e $request_filename) {
rewrite / /index.php last;
}
expires off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
try_files $uri $uri/ @handler;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_param HTTPS $fastcgi_https;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params;
}