Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

316
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda