Skip to content

Instantly share code, notes, and snippets.

@ndavison
Last active January 3, 2017 00:37
Show Gist options
  • Save ndavison/5c8d73a242bd85231387 to your computer and use it in GitHub Desktop.
Save ndavison/5c8d73a242bd85231387 to your computer and use it in GitHub Desktop.
Nginx load balancing configuration for HHVM and Drupal
upstream myapp1 {
server 127.0.0.1:9000;
server 127.0.0.1:9001;
}
server {
listen 80;
server_name localhost;
root /var/www/html;
index index.php;
location / {
error_page 404 = @drupal;
}
location ~ \.(php|module|profile|theme|inc|install|info|test)$ {
fastcgi_pass myapp1;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location @drupal {
rewrite ^(.*)$ /index.php?q=$1 last;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment