Skip to content

Instantly share code, notes, and snippets.

@azhai
Created October 19, 2013 03:53
Show Gist options
  • Save azhai/7051464 to your computer and use it in GitHub Desktop.
Save azhai/7051464 to your computer and use it in GitHub Desktop.
Nginx PHP (Simple)
server {
listen 80;
server_name blog.com;
root /var/www/wordpress;
set $var_sessid "-";
access_log logs/blog.access.log main;
#charset utf-8;
index index.html index.php;
error_page 404 /404.html;
if (!-e $request_filename) {
rewrite .* /index.php$request_uri last;
}
location ~ \.(svn|git|hg|bzr|cvs) {
return 404;
}
location ~* \.php {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment