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

250
Visualizações
Correctly serving manifest.json via Django's gunicorn

I have a Django web app that utilizes an nginx reverse proxy with a gunicorn application server (upstream).

My nginx logs are filling up with errors like these: 2020/03/03 22:51:57 [error] 9605#9605: *162393 upstream sent too big header while reading response header from upstream, client: 168.155.46.104, server: example.com, request: "GET /static/img/favicons/manifest.json HTTP/2.0", upstream: "http://unix:/home/ubuntu/app/myproj/gunicorn.sock:/static/img/favicons/manifest.json", host: "example.com", referrer: "https://example.com/signup/create-pass/new/6d756265726e2d3131/18/"

I'm assuming gunicorn was unable to serve manifest.json.

This shouldn't have happened. I've created manifest.json and placed it in the relevant location. Using the Favicon checker at https://realfavicongenerator.net/ shows me this error: The Web App Manifest at https://example/com/static/img/favicons/site.webmanifest cannot be downloaded. If I hit that url directly in the brower, I end up seeing a 502 Bad Gateway error.

How can I fix this?

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

0

I figured out the error.

Files placed in the /static/ folder in my project are supposed to be served directly via nginx. But the json file in question wasn't included in nginx conf in a manner that allowed it to be served by the web server.

Once I fixed that (see below), the manifest file was directly served by nginx (and gunicorn never came in the loop). Problem solved!


This is what I added to nginx's virtual host file to solve the issue: Notice this includes the json extension:

location ~* \.(?:ico|css|js|gif|jpg|jpeg|png|svg|woff|ttf|eot|json)$ {

    root /home/ubuntu/app/my_proj;
    expires 120d;
    access_log off;
    error_log off;
}
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