Browse files

Config for local wordpress sites

  • Loading branch information...
1 parent e118336 commit e4767dd4e16105825b7ec8304d23b3ec937cf575 @pengwynn committed Apr 2, 2012
Showing with 21 additions and 10 deletions.
  1. +1 −0 nginx/nginx.conf
  2. +1 −1 nginx/vhosts/thechangelog.conf
  3. +12 −9 nginx/vhosts/wordpress.conf
  4. +7 −0 wordpress/wordpress.zsh
View
1 nginx/nginx.conf
@@ -10,6 +10,7 @@ events {
http {
include mime.types;
default_type application/octet-stream;
+ client_max_body_size 20m;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
View
2 nginx/vhosts/thechangelog.conf
@@ -1,6 +1,6 @@
server {
listen 80;
- server_name thechangelog.local;
+ server_name tcl-nesta.local;
root /Users/wynn/sites/thechangelog/public;
location / {
View
21 nginx/vhosts/wordpress.conf
@@ -35,11 +35,21 @@ server {
}
location / {
- try_files $uri $uri/ @rewrite;
+ rewrite ^/?post/([0-9]+).*$ http://thechangelog.local/$1;
+ try_files $uri $uri/ @rewrite;
+ if (!-e $request_filename) {
+ rewrite ^.+?(/.*.php)$ $1 last;
+ rewrite ^ /index.php last;
+ rewrite ^/css/(.)$ /wp-content/themes/$site/css/$1 last;
+ rewrite ^/js/(.)$ /wp-content/themes/$site/js/$1 last;
+ rewrite ^/img/(.)$ /wp-content/themes/$site/img/$1 last;
+ rewrite ^/plugins/(.)$ /wp-content/plugins/$1 last;
+ break;
+ }
}
location @rewrite {
- rewrite ^/(.*)$ /index.php?q=$1;
+ #rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ \.php$ {
@@ -55,11 +65,4 @@ server {
try_files $uri $uri/ @rewrite;
}
- if (!-e $request_filename) {
- rewrite ^/css/(.)$ /wp-content/themes/$site/css/$1 last;
- rewrite ^/js/(.)$ /wp-content/themes/$site/js/$1 last;
- rewrite ^/img/(.)$ /wp-content/themes/$site/img/$1 last;
- rewrite ^/plugins/(.)$ /wp-content/plugins/$1 last;
- break;
- }
}
View
7 wordpress/wordpress.zsh
@@ -0,0 +1,7 @@
+function wp-clone() {
+ DEST=$1
+ mkdir -p $DEST
+ curl http://wordpress.org/latest.tar.gz | tar xvz -C $DEST
+ mv $DEST/wordpress/* $DEST
+ rm -rf $DEST/wordpress
+}

0 comments on commit e4767dd

Please sign in to comment.