Re-do the tracking section

This commit is contained in:
TheMaddax 2024-12-11 21:59:51 -06:00
parent f0135e4e54
commit fd00d16c37
3 changed files with 96 additions and 106 deletions

View file

@ -45,6 +45,7 @@ COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/public/images/ /usr/share/nginx/html/images/ COPY --from=builder /app/public/images/ /usr/share/nginx/html/images/
COPY --from=builder /app/public/subtitles /usr/share/nginx/html/subtitles COPY --from=builder /app/public/subtitles /usr/share/nginx/html/subtitles
COPY --from=builder /app/public/transcriptions /usr/share/nginx/html/transcriptions COPY --from=builder /app/public/transcriptions /usr/share/nginx/html/transcriptions
COPY matomo_log_format.conf /etc/nginx/conf.d/
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# Add runner stage verification to the file # Add runner stage verification to the file

4
matomo_log_format.conf Normal file
View file

@ -0,0 +1,4 @@
log_format matomo_tracking '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'$request_time';

View file

@ -1,24 +1,10 @@
http { server {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Matomo tracking log format
log_format matomo_tracking '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'$request_time';
# Compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
server {
listen 804; listen 804;
server_name localhost; server_name localhost;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
# Log paths and format # Updated log paths and format
access_log /var/log/nginx/deafgain-website/access.log matomo_tracking buffer=512k flush=1m; access_log /var/log/nginx/deafgain-website/access.log matomo_tracking buffer=512k flush=1m;
error_log /var/log/nginx/deafgain-website/error.log error; error_log /var/log/nginx/deafgain-website/error.log error;
@ -34,6 +20,10 @@ http {
add_header X-Content-Type-Options "nosniff"; add_header X-Content-Type-Options "nosniff";
add_header Strict-Transport-Security "max-age=31536000"; add_header Strict-Transport-Security "max-age=31536000";
# Compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# API endpoint # API endpoint
location /api/contact { location /api/contact {
proxy_pass http://api:3000; proxy_pass http://api:3000;
@ -113,9 +103,4 @@ http {
expires 30d; expires 30d;
add_header Cache-Control "public, no-transform"; add_header Cache-Control "public, no-transform";
} }
}
}
events {
worker_connections 1024;
} }