Skip to content

Instantly share code, notes, and snippets.

@roobre
Last active March 31, 2016 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roobre/68b7903787a509c946f5a2d093832160 to your computer and use it in GitHub Desktop.
Save roobre/68b7903787a509c946f5a2d093832160 to your computer and use it in GitHub Desktop.
Nginx config for wordpress
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
server {
listen 80;
server_name example.tld;
client_max_body_size 20M;
root /var/www/wordpress;
index index.php;
error_page 404 /index.php?error=404;
location ~* (?i)(readme|changelog|license|version)(\..+)?$ {
return 404;
}
location ~* /(wp-links-opml\.php|xmlrpc\.php) {
return 404;
}
location ~* /(wp-admin|wp-login.php) {
allow 10.0.0.0/8;
deny all;
include conf.d/php.conf;
}
include conf.d/php.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment