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

242
Visualizações
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 Respostas
Responde à pergunta

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 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