3
我正在與HHVM上nginx的PHP應用程序爲主要和PHP-FPM作爲備份HHVM退回到PHP-FPM
這是我關於PHP處理
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;
}
爲了測試Nginx的配置的配置,我停止了HHVM service.Normally,將請求傳遞給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
難道我做錯了什麼在這裏
其實,我想這一個too.I知道我寫的是多餘的,但由於此配置沒有工作,我寫的以這種方式進行配置,但即使這樣也會引發錯誤。 – 5ud0
我發現它, 顯然,根據官方指示,我在nginx虛擬主機中包含了hhvm.conf,似乎覆蓋了php-fpm並嘗試連接它! 刪除它解決了問題 – 5ud0
@ 5ud0我有生產服務器運行這個配置,它的工作完美 –