question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to configure nginx config?

See original GitHub issue

Hi, I have a docker container running with:

FROM tiangolo/uwsgi-nginx-flask:python3.6
COPY requirements.txt /tmp/
RUN pip install -U pip
RUN pip install -r /tmp/requirements.txt
COPY ./app /app

When running (it runs flawless except for this), there is a particular action that causes the server to crash with the following message:

2018/10/02 13:06:43 [error] 10#10: *9 upstream sent too big header while reading response header from upstream

I’m aware that the problem is with the nginx.config file and that it is located in /etc/nginx/conf.d/nginx.conf. More particularly, I have to add the answer here to the file. Because the request header is too large.

I have tried to modify that file while building the docker image, but haven’t figured out exactly how to do it.

Here is my project tree:

β”œβ”€β”€ Dockerfile
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ data
β”‚   β”‚   └── users.json
β”‚   β”œβ”€β”€ forms.py
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ static
β”‚   β”‚   β”œβ”€β”€ ajax-loader.gif
β”‚   β”‚   └── logo.png
β”‚   β”œβ”€β”€ templates
β”‚   β”‚   β”œβ”€β”€ 404.html
β”‚   β”‚   β”œβ”€β”€ 500.html
β”‚   β”‚   β”œβ”€β”€ base.html
β”‚   β”‚   └── upload.html
β”‚   └── utils.py
└── requirements.txt

How exactly should I proceed?

Sorry for the question, appreciate any help and this awesome image!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

9reactions
tiangolocommented, Oct 15, 2018

Let’s say you create a file buffer-size.conf:

uwsgi_buffer_size 24k;

that file is right beside your Dockerfile, that now has an additional line:

COPY ./buffer-size.conf /etc/nginx/conf.d/

…so your final Dockerfile might look like:

FROM tiangolo/uwsgi-nginx-flask:python3.6

COPY ./buffer-size.conf /etc/nginx/conf.d/

COPY requirements.txt /tmp/
RUN pip install -U pip
RUN pip install -r /tmp/requirements.txt
COPY ./app /app
2reactions
tiangolocommented, Nov 23, 2018

I guess the original issue of this thread was solved too, so I’ll close it.

But feel free to add more comments or open new issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beginner's Guide - Nginx.org
The way nginx and its modules work is determined in the configuration file. By default, the configuration file is named nginx.conf and placed...
Read more >
Full Example Configuration - NGINX
A full-fledged example of an NGINX configuration.
Read more >
How to Configure NGINX | Linode
All NGINX configuration files are located in the /etc/nginx/ directory. The primary configuration file is /etc/nginx/nginx.conf .
Read more >
NGINX Configuration Guide: How to Get Started - Plesk
Every NGINX configuration file will be found in the /etc/nginx/ directory, with the main configuration file located in /etc/nginx/nginx.conf ...
Read more >
Install and configure Nginx - Ubuntu
In this tutorial we'll install Nginx and set up a basic site. What you'll learn. How to set up Nginx; Some basic Nginx...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found