Last active
March 31, 2016 11:07
-
-
Save roobre/68b7903787a509c946f5a2d093832160 to your computer and use it in GitHub Desktop.
Nginx config for wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_pass unix:/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi.conf; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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