Add a note regarding the robots.txt config

This commit is contained in:
h3artbl33d 2024-06-04 14:25:30 +02:00
parent 21e2e91c6d
commit e23fe6a64d

View File

@ -8,6 +8,20 @@
# -h3artbl33d
###
###
# Regarding the robots, you can also choose to serve a static version, like:
# location = /robots.txt {
# access_log off;
# add_header Content-Type text/plain;
# return 200 "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n\nSitemap: /sitemap_index.xml\n\nUser-agent: YandexBot\nDisallow: /\n\nUser-agent: ClaudeBot\nDisallow: /\n\nUser-agent: 360Spider\nDisallow: /\n\nUser-agent: AhrefsBot\nDisallow: /\n\nUser-agent: Baiduspider\nDisallow: /\n\nUser-agent: BLEXBot\nDisallow: /\n\nUser-agent: DotBot\nDisallow: /\n\nUser-agent: Exabot\nDisallow: /\n\nUser-agent: MJ12bot\nDisallow: /\n\nUser-agent: PetalBot\nDisallow: /\n\nUser-agent: SEOkicks-Robot\nDisallow: /\n\nUser-agent: SemrushBot\nDisallow: /\n\nUser-agent: SiteExplorer\nDisallow: /\n\nUser-agent: Sogou\nDisallow: /\n\nUser-agent: spbot\nDisallow: /\n\nUser-agent: YandexImages\nDisallow: /\n\nUser-agent: Yeti\nDisallow: /\n\nUser-agent: YisouSpider\nDisallow: /\n";
# }
###
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
try_files $uri /index.php?$args;
}
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
@ -17,12 +31,6 @@ location = /favicon.ico {
location @empty {
empty_gif;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
try_files $uri /index.php?$args;
}
location ~ ^/wp-content/uploads/sucuri {
deny all;
}
@ -56,9 +64,11 @@ location ^~ /wp-admin/install.php {
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location ~* ^/(wp-content)/(.*?)\.(zip|gz|tar|bzip2|7z)\$ {
deny all;
}
location ~* ^/wp-content/plugins/.+\.(txt|log|md)$ {
deny all;
error_page 403 =404 /;
@ -93,8 +103,8 @@ location ~ /\.ht {
}
location ~ /\.user.ini {
deny all;
access_log off;
log_not_found off;
access_log off;
log_not_found off;
}
location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ {
deny all;
@ -112,6 +122,7 @@ location ~* ^/(?:wp-content|wp-includes)/.*\.php$ {
location ~* ^/(?:xmlrpc\.php|wp-links-opml\.php|wp-config\.php|wp-config-sample\.php|wp-comments-post\.php|readme\.html|license\.txt)$ {
deny all;
}
location ~ /\. {
deny all;
}