Piwik.js not found



When I add a javascript tracking code to my site, I get error_log full of these errors:

2014/09/11 10:08:24 [error] 9784#0: *268482 open() "/home/user/public_html/mysite/piwik.js" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: mysite.com, request: "GET /piwik.js HTTP/1.1", host: "stat.mydomain.com", referrer: "http://www.mysite.com/"

Now the directory structure is as follows:
Piwik : /home/myownuser/public_html/piwik
Site : /home/user/public_html/mysite

Piwik url is https://stat.mydomain.com and site url is: http://mysite.com

So it is looking for piwik.js in totally wrong place, it should be /home/myownuser/public_html/piwik/piwik.js.

I’m running Ubuntu 14.04 and nginx + php-fpm. I have not modified the tracking code myself, just copy-pasted it from Piwik.

Any ideas how to fix this behaviour?