Skip to content

Instantly share code, notes, and snippets.

@samirfor
Last active August 29, 2015 14:08
Show Gist options
  • Save samirfor/784483e29069a548a635 to your computer and use it in GitHub Desktop.
Save samirfor/784483e29069a548a635 to your computer and use it in GitHub Desktop.
Config. PHP Nginx
# Simple include for PHP files
# Put this file in /etc/nginx/conf.d/
index index.php index.html;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param APPLICATION_ENV development;
fastcgi_intercept_errors on;
fastcgi_index index.php;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment