title: Where to place nginx.conf file in docker container
body: <p>I have a flask app running in AWS ec2 inside a docker container and I am having latency problems. I figured this is because inside the container, localhost routes to both ipv4's <code>127.0.0.1</code> and ipv6's <code>::1</code> (based on some other SO posts). I found <a href="https://blog.jverkamp.com/2015/04/03/performance-problems-with-flask-and-docker/" rel="nofollow noreferrer">this blog post</a> which addresses the issue exactly. But in the blog he uses nginx, which I've never used before. He has an nginx config file:</p>
  
  <pre><code>location / { try_files $uri @project; }
  location @project {
      include uwsgi_params;
      uwsgi_pass unix:/tmp/uwsgi.sock;
  }
  </code></pre>
  
  <p>and I'm not sure how I can place this in the container so that it reads properly. I read somewhere that it goes in /etc/nginx, but then how do I edit the dockerfile to include this conf there?</p>
  
  <p>This is the Dockerfile he suggests. Is the line <code>ADD nginx /etc/nginx</code> where the file is getting copied in? and he just didn't give the file an extension?</p>
  
  <pre><code>FROM ubuntu:14.04
  
  RUN apt-get update &amp;&amp; apt-get install -y build-essential nginx python3.4 python3.4-dev
  RUN easy_install3 pip
  
  WORKDIR /project
  
  ADD requirements.txt /project/requirements.txt
  RUN pip install -r requirements.txt
  
  ADD . /project
  
  ADD nginx /etc/nginx
  
  CMD uwsgi -s /tmp/uwsgi.sock -w project:app --chown-socket=www-data:www-data --enable-threads &amp; \
      nginx -g 'daemon off;'
  </code></pre>