Skip to content

Instantly share code, notes, and snippets.

@lesterchan
Created April 24, 2015 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesterchan/3cd6126f5604fe0e6bcf to your computer and use it in GitHub Desktop.
Save lesterchan/3cd6126f5604fe0e6bcf to your computer and use it in GitHub Desktop.
HHVM with PHP-FPM fallback
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