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

245
Vistas
wild card match on request headers for nginx

I am using nginx as a proxy server to send the requests to backend pool members .

I have a header -- Content-Type: multipart/form-data; boundary="21ad608c-8e00-4c0c-8a06-5ed1280e9532" The boundary value in the header changes all the time.

How can I do a header check for only "Content-Type: multipart/form-data;" value and route the requests to the backend. when I do a print of $http_content_type value , everything including boundary value is getting printed . I am not able to do an if check on just " Content-Type: multipart/form-data; " value .

Can I put a wild card in the nginx config like -- "multipart/form-data; * " to pass the if loop ?

Please let me know.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

An Nginx wildcard? Yes, sort of, via a regex:
if ($http_content_type !~ '^multipart/form-data;') deny-the-request

This means that the Content-Type must start with multipart/form-data;. After that, any boundary=...whatever... is allowed.

Complete example:

  location /-/upload-public-file {
    limit_except POST OPTIONS {
      deny  all;
    }

    if ($http_content_type !~ '^multipart/form-data;') {
      return 406;  # status code Not acceptable
    }
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