Skip to content
Snippets Groups Projects
Commit 69562bfc authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat: update nginx conf for matomo

parent 62cd04b6
No related branches found
No related tags found
2 merge requests!68Recette,!67Dev
...@@ -2,11 +2,25 @@ server { ...@@ -2,11 +2,25 @@ server {
listen 8080 default_server; listen 8080 default_server;
root /usr/share/nginx/html/; root /usr/share/nginx/html/;
set $matomo_script
"<script type='text/javascript'>
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u='<URL_GDLYON>';
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '<SITE_ID>']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>";
location / { location / {
# First attempt to serve request as file, then # First attempt to serve request as file, then
# as directory, then fall back to displaying a 404. # as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
sub_filter '</head>' '$matomo_script</head>';
} }
location /api { location /api {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment