Running Piwik on Nginx which is a reverse proxy to Apache

700 views Asked by At

In my current environment I have a web app running on Apache (no php is being used) with Nginx serving as a reverse proxy.

If I have Piwik installed on Nginx, where all php is being served by Ngnix, will Piwik still be able to track analytics correctly if I have the Piwik javascript blocks included in the code that is running on the Apache servers?

1

There are 1 answers

0
McLovin On BEST ANSWER

The answer is yes. In the nginx.conf file you need to add

location /path_to_piwik_files/ {
    try_files $uri $uri/ @proxy;
}

location @proxy {
   proxy_pass   http:/website;
}