title: Heroku + docker + nginx every request returns 500
body: <p>I deploy my docker container to Heroku hosting. Container contains nginx and static files, created by webpack on contained-build stage. 
  root directory is /data/www with index.html, style.css, style.css.map, bundle.js, vendor.bundle.js and directories with assets(images/ etc)</p>
  
  <p>my nginx conf:</p>
  
  <pre><code>worker_processes auto;
  
  events {
      use epoll;
      multi_accept on;
  }
  
  http {
      access_log /dev/stdout;
      error_log /dev/stdout info;
      server {
          include listen.conf;
  
          types{
              text/javascript   js;
              text/css          css;
              image/jpeg        jpg;
              image/png         png;
          }
          default_type text/html;
  
          root /data/www;
          index /index.html;
          location / {
              try_files $uri $uri/ /index.html;
          }
      }
  }
  </code></pre>
  
  <p>it works locally, but when I push image to Heroku:</p>
  
  <pre><code>docker build -t registry.heroku.com/tp-frontend-kv/web .
  docker push registry.heroku.com/tp-frontend-kv/web
  </code></pre>
  
  <p>Every request returns 500, nginx log on Heroku :</p>
  
  <pre><code>2017-05-21T10:31:09.254234+00:00 heroku[router]: at=info method=GET path="/" host=tp-frontend-kv.herokuapp.com request_id=63388b37-4b9b-432b-88c2-8ae393e2708d fwd="178.22.54.74" dyno=web.1 connect=1ms service=1ms status=500 bytes=355 protocol=https
  
  2017-05-21T10:31:09.256223+00:00 app[web.1]: 2017/05/21 10:31:09 [error] 14#14: *4 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 10.84.188.241, server: , request: "GET / HTTP/1.1", host: "tp-frontend-kv.herokuapp.com", referrer: "https://dashboard.heroku.com/"
  
  2017-05-21T10:31:09.256368+00:00 app[web.1]: 10.84.188.241 - - [21/May/2017:10:31:09 +0000] "GET / HTTP/1.1" 500 193 "https://dashboard.heroku.com/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
  
  2017-05-21T10:31:14.935539+00:00 app[web.1]: 2017/05/21 10:31:14 [error] 13#13: *5 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 10.84.188.241, server: , request: "GET /index.html HTTP/1.1", host: "tp-frontend-kv.herokuapp.com"
  
  2017-05-21T10:31:14.935653+00:00 app[web.1]: 10.84.188.241 - - [21/May/2017:10:31:14 +0000] "GET /index.html HTTP/1.1" 500 193 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
  
  2017-05-21T10:31:14.934805+00:00 heroku[router]: at=info method=GET path="/index.html" host=tp-frontend-kv.herokuapp.com request_id=c7a3943b-3714-4745-8758-37002e735d6e fwd="178.22.54.74" dyno=web.1 connect=0ms service=2ms status=500 bytes=355 protocol=https
  </code></pre>
  
  <p>What could be the problem?</p>
  
  <p>PS dockerfile and others : <a href="https://github.com/frontend-park-mail-ru/2017_1_KV-Team/tree/dev" rel="nofollow noreferrer">github</a></p>