Welcome! Log In Create A New Profile

Advanced

Re: Piwik conf file

August 20, 2013 07:06PM
Thank you for your responses!

On Tue, Aug 20, 2013 at 2:44 PM, Francis Daly <francis@daoine.org> wrote:
> 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.

Yes, I fixed that by changing to /piwik/js/ - is this the right way to
enter it? Here is what the file would read now:

location /piwik/ {

location /piwik/js/ {
allow all;
}

location ~ /piwik/js/.*\.php$ {
include /etc/nginx/global-configs/php.conf;
}

location ~ /piwik/piwik.php$ {
include /etc/nginx/global-configs/php.conf;
}

return 301 https://www.unpm.org$request_uri?;
}

>
> 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.

Yes, to be honest, that config is beyond my current understanding of
nginx. I reviewed the GitHub entry on the configuration, and it
included instructions to "Move the old /etc/nginx directory to
/etc/nginx.old" which seems a bit extreme to me and more work to
reconfigure for the other settings on my server, not to mention that
their /etc/nginx.conf file, among others, hasn't been updated in 2
years.

I have the Mastering Nginx book, but I still struggle to decode many
example configurations. I especially struggle with regular
expressions.

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

The nginx FAQ points to the above GitHub page.

>> 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?

The Piwik dashboard is located in /piwiki/index.php, and that is what
always needs to be served securely.

The tracking code for Piwik is loaded with either /piwik/js/index.php,
/piwik/piwik.php, or the /piwik/js/ directory, depending on various
client or server configurations.

Thank you for you help!

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Piwik conf file

openletter August 19, 2013 05:56PM

Re: Piwik conf file

Francis Daly August 20, 2013 05:46PM

Re: Piwik conf file

openletter August 20, 2013 07:06PM

Re: Piwik conf file

Francis Daly August 21, 2013 02:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 269
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready