matomo-org / matomo-nginx

Nginx configuration for running Matomo
406 stars 121 forks source link

net::ERR_EMPTY_RESPONSE:The server closed the connection without sending any data." #34

Closed digjack closed 6 years ago

digjack commented 7 years ago

I have install the piwik with nginx complete, and when I view renew the webpage , then the chrome console come with the error like net::ERR_EMPTY_RESPONSE:The server closed the connection without sending any data." after check the config for a while , I found the solution. the question is nothing to do with the piwik, but the nginx config. From the offical nginx conf, I found a line like this

location ~* ^.+\.(?:jpg|png|css|gif|jpeg|js|swf)$ {
  # Defining the valid referers.
                  valid_referers none blocked *.piwik.com   othersite.com;   //change this line to deal question
                  if ($invalid_referer)  {
                          return 444;
                  }
                  expires max;
                  break;
         }

when we add tracker to the other site for tracking . the application will get the piwik.js from piwik application. and if this conf doesn't contain the refering url . the nginx will reject this request and return http code 444. my solution is add the valid url here . and the error disappear.

mattab commented 6 years ago

PR in https://github.com/perusio/piwik-nginx/pull/39 should fix this issue?