Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

315
Visualizações
Blocking case insensitive path (/admin) in nginx server

I have a requirement; any hits with /admin is blocked in the firewall but ppl are accessing it with upper case combinations like /Admin or /adMin or anything like this.

To block admin access for outside, its hard to make firewall rule for all the combinations, hence looking for some method in nginx to block this,

Please note we also need to block the subpaths like /admin/img/one.jpg (subpaths are case sensitive only admin is insensitive). Existing firewall rule is to block all outside access for /admin and allows only VPN access.

Kindly help if more details required I will update this ticket.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can use a case insensitive regular expression, either using the ~* operator or using a series of character classes.

Any of the following should work:

location ~* ^/admin { return 403; }

if ($request_uri ~* ^/admin) { return 403; }

rewrite ^/[Aa][Dd][Mm][Ii][Nn] /goaway.html redirect;

Each of the above regular expressions match the beginning of the URI, so URIs containing subpaths will also match.

See this document for location, this document for if, and this document for rewrite.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda