Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

251
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!