Skip to content

Instantly share code, notes, and snippets.

@4lun
Last active January 2, 2016 14:56
Show Gist options
  • Save 4lun/556a57194bad38158c24 to your computer and use it in GitHub Desktop.
Save 4lun/556a57194bad38158c24 to your computer and use it in GitHub Desktop.
Piwik nginx config (including way to rename piwik client files)
server {
listen 80;
listen [::]:80 ipv6only=on;
root /var/piwik;
index index.php index.html index.htm;
server_name piwik.local;
location / {
try_files $uri $uri/ =404;
}
# Alternative url for piwik.js - obscure the presence of Piwik
# (You can also create _.php in the root directory that requires piwik.php)
location = /_.js {
try_files /piwik.js =404;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment