Hallo, ich versuche gerade bei nginx Wordpress etwas sicherer zu machen. Dazu habe ich folgende vhost in "sites-custom" die eingebunden wird:
wordpress.conf:
Code
#Deny access to wp-content folders for suspicious files
location ~* ^/(wp-content)/(.*?)\.(zip|gz|tar|bzip2|7z)\$ { deny all; }
location ~ ^/wp-content/uploads/sucuri { deny all; }
location ~ ^/wp-content/updraft { deny all; }
# Deny access to any files with a .php extension in the uploads directory
# Works in sub-directory installs and also in multisite network
location ~* /(?:uploads|files)/.*\.php\$ { deny all; }
# Deny access to uploads that aren’t images, videos, music, etc.
location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php|js|swf|css)$ {
deny all;
}
# Block PHP files in content directory.
location ~* /wp-content/.*\.php\$ {
deny all;
}
# Block PHP files in includes directory.
location ~* /wp-includes/.*\.php\$ {
deny all;
}
# Block PHP files in uploads, content, and includes directory.
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)\$|^(\..*|Entries.*|Repository|Root|Tag|Template)\$|\.php_
{
return 444;
}
# Stop image hotlinking
location ~ .(gif|png|jpe?g)$ {
valid_referers none blocked ${MYDOMAIN} *.${MYDOMAIN};
if ($invalid_referer) {
return 403;
}
}
Alles anzeigen
In der nginx.conf ist try uri uri aktiviert.
Hat jemand noch eine Idee, ob oder was man an der conf verbessern könnte?
LG