Created
April 24, 2015 06:50
-
-
Save lesterchan/3cd6126f5604fe0e6bcf to your computer and use it in GitHub Desktop.
HHVM with PHP-FPM fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.(hh|php)$ { | |
proxy_intercept_errors on; | |
error_page 502 = @fallback; | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
if (!-f $document_root$fastcgi_script_name) { | |
return 404; | |
} | |
fastcgi_keep_conn on; | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_pass unix:/var/run/hhvm/server.sock; | |
} | |
location @fallback { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
if (!-f $document_root$fastcgi_script_name) { | |
return 404; | |
} | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment