Skip to content

Instantly share code, notes, and snippets.

@andreferraro
Last active August 29, 2015 14:25
Show Gist options
  • Save andreferraro/6b78a7570db8f634ba72 to your computer and use it in GitHub Desktop.
Save andreferraro/6b78a7570db8f634ba72 to your computer and use it in GitHub Desktop.
location ~ \.(hh|php)$ {
proxy_intercept_errors on;
error_page 502 = @fallback;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_keep_conn on;
include /etc/nginx.custom.d/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 /etc/nginx.custom.d/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;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment