Skip to content

Instantly share code, notes, and snippets.

@thesabbir
Created May 4, 2014 18:21
Show Gist options
  • Save thesabbir/d9e9877a96264aa8bd98 to your computer and use it in GitHub Desktop.
Save thesabbir/d9e9877a96264aa8bd98 to your computer and use it in GitHub Desktop.
Nginx 1.6 Config (OS X, Homebrew) For localhost Wordpress Installation.
server {
listen 80;
root /Users/sabbir/FLow/php/wordpress;
index index.php;
server_name wp.dev;
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /Users/sabbir/FLow/php/wordpress;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
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