refactor: Especializa snippets well-known (robots, ads, security)

This commit is contained in:
João Pedro Toledo Goncalves 2026-02-04 19:29:12 -03:00
parent b6997959e9
commit 396bda5977
8 changed files with 28 additions and 43 deletions

View File

@ -1,13 +0,0 @@
# Ads.txt - Vendedores Autorizados de Anúncios
# Função: Lista quem está autorizado a vender o inventário de anúncios do site para evitar fraudes.
location = /ads.txt {
allow all;
log_not_found off;
access_log off;
try_files /ads.txt @proxy_ads;
}
location @proxy_ads {
include snippets/proxy_params.conf;
proxy_pass $upstream_proto://$upstream_app;
}

View File

@ -0,0 +1,8 @@
# ads_disallow.conf - Bloquear Todos os Vendedores de Anúncios
# Função: Indica que nenhum vendedor está autorizado, prevenindo anúncios não autorizados.
location = /ads.txt {
allow all;
log_not_found off;
access_log off;
return 200 "contact=suporte@itguys.com.br\n";
}

View File

@ -4,10 +4,5 @@ location = /humans.txt {
allow all; allow all;
log_not_found off; log_not_found off;
access_log off; access_log off;
try_files /humans.txt @proxy_humans; try_files /humans.txt =404;
}
location @proxy_humans {
include snippets/proxy_params.conf;
proxy_pass $upstream_proto://$upstream_app;
} }

View File

@ -1,16 +0,0 @@
# Robots.txt - Controle de Crawler
# Função: Indica para robôs (Google, Bing, IA) o que pode ou não ser indexado.
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
# Exemplo de conteúdo direto (opcional):
# return 200 "User-agent: *\nDisallow: /admin/\nSitemap: $scheme://$host/sitemap.xml";
try_files /robots.txt @proxy_robots;
}
location @proxy_robots {
# Caso não exista no proxy, tenta buscar no backend
include snippets/proxy_params.conf;
proxy_pass $upstream_proto://$upstream_app;
}

View File

@ -0,0 +1,8 @@
# robots_allow.conf - Permitir Tudo
# Função: Indica que todos os robôs podem indexar todo o site.
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
return 200 "User-agent: *\nAllow: /\n";
}

View File

@ -0,0 +1,8 @@
# robots_disallow.conf - Bloquear Tudo
# Função: Indica que nenhum robô deve indexar o site.
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
return 200 "User-agent: *\nDisallow: /\n";
}

View File

@ -4,10 +4,5 @@ location = /.well-known/security.txt {
allow all; allow all;
log_not_found off; log_not_found off;
access_log off; access_log off;
try_files /.well-known/security.txt /security.txt @proxy_security; return 200 "Contact: mailto:suporte@itguys.com.br\nPreferred-Languages: pt, en\n";
}
location @proxy_security {
include snippets/proxy_params.conf;
proxy_pass $upstream_proto://$upstream_app;
} }

View File

@ -1,7 +1,7 @@
# Agregador de Arquivos de Identificação e Controle (Well-Known / Root Files) # Agregador de Arquivos de Identificação e Controle (Well-Known / Root Files)
# Função: Inclui todos os snippets padrão de identificação em um único comando. # Função: Inclui todos os snippets padrão de identificação em um único comando.
include snippets/robots.txt.conf; include snippets/robots_disallow.conf;
include snippets/security.txt.conf; include snippets/security.txt.conf;
include snippets/humans.txt.conf; include snippets/humans.txt.conf;
include snippets/ads.txt.conf; include snippets/ads_disallow.conf;