简体   繁体   中英

Running Piwik on Nginx which is a reverse proxy to Apache

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?

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;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM