Piwik conf file

Francis Daly francis at daoine.org
Tue Aug 20 21:44:26 UTC 2013

On Mon, Aug 19, 2013 at 02:53:36PM -0700, Paul N. Pace wrote:

Hi there,

> I am trying to set up a conf file for Piwik installations and I'm
> hoping a second set of of eyes can help:

In nginx one request is handled in one location. The rules for selecting
the location are at http://nginx.org/r/location

Given that information, the following output...

> location /piwik/ {
>      location /js/ {
>          allow all;
>      }
>      location ~ /js/.*\.php$ {
>          include /etc/nginx/global-configs/php.conf;
>      }
>     location ~ /piwik.php$ {
>          include /etc/nginx/global-configs/php.conf;
>      }
>     return 301 https://server_name$request_uri?;
> }

$ sbin/nginx -t
nginx: [emerg] location "/js/" is outside location "/piwik/" in /usr/local/nginx/conf/nginx.conf:14
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

should not be a surprise.

Can you list some of the requests that you want to have handled, and
how you want them to be handled? That might help someone who knows nginx
but not piwik to understand what the intention is.

Doing a web search for "site:nginx.org piwik" does seem to point at a
config file, which seems very different from yours.

Searching for "nginx" on the piwik.org web site also refers to an
install document.

Do those documents offer any help to what you are doing?

> Piwik seems trickier than other applications because certain
> components must be available through HTTP sessions or else browsers
> give scary warnings or don't load the tracking code, but I want to
> force the Piwik dashboard to open in HTTPS.

These words don't obviously directly translate to your config file
snippet above. What request is the Piwik dashboard? What request is
certain components?

Francis Daly        francis at daoine.org

More information about the nginx mailing list