Skip to content

Instantly share code, notes, and snippets.

@gabrielhpugliese
Created July 30, 2012 21:05
Show Gist options
  • Save gabrielhpugliese/3210236 to your computer and use it in GitHub Desktop.
Save gabrielhpugliese/3210236 to your computer and use it in GitHub Desktop.
nginx wordpress config
server{
listen 80; #or change this to your public IP address eg 1.1.1.1:80
server_name www.blogcloud.com.br; #change this to the domain name, for example www.myblog.com
access_log /var/log/wordpress.access_log;
error_log /var/log/wordpress.error_log;
location / {
root /home/wordpress/public_html/wordpress;
index index.php;
# this serves static files that exist without running other rewrite tests
if (-f $request_filename) {
expires 30d;
break;
}
# this sends all non-existing file or directory requests to index.php
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:53217;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/wordpress/public_html/wordpress$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment