我在nginx上运行PHP应用程序,HHVM为主,PHP-FPM为备份
这是我关于php处理的nginx配置
location ~ \.(hh|php)${
fastcgi_intercept_errors on;
error_page 500 501 502 503 = @fallback;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_keep_conn on;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
fastcgi_pass 127.0.0.1:9000;
}
location @fallback {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
为了测试配置,我停止了hhvm服务.通常会将请求传递给PHP-FPM并且应该返回200但是我得到502错误如下:
12296#0: *17 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.34.235, server: stylep3.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:localhost
我在这做错了吗?