Skip to content

Instantly share code, notes, and snippets.

@xluffy
Created April 17, 2015 03:14
Show Gist options
  • Save xluffy/bd25251e38a86717f09a to your computer and use it in GitHub Desktop.
Save xluffy/bd25251e38a86717f09a to your computer and use it in GitHub Desktop.
nginx_wp
server {
listen 80;
server_name demo.wp.com;
root /home/wp/public;
index index.php index.html index.htm;
access_log /var/log/nginx/wp_access.log;
error_log /var/log/nginx/wp_error.log;
location /blog {
index index.php;
try_files $uri $uri/ /blog/index.php?q=$uri&$args;
}
location ~* \.(js|css)$ {
expires 14d;
root /home/wp/public/blog;
access_log off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-wp.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment