Skip to content
Snippets Groups Projects
Commit 4bdc59a4 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS Committed by Etienne LOUPIAS
Browse files

feat(jeuIA): store nginx logs

parent 29f8fcc3
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ COPY angular.json .
COPY tsconfig.json .
COPY tsconfig.app.json .
COPY ngsw-config.json .
COPY /nginx/nginx.conf .
COPY /src ./src
ARG conf
......
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'"$upstream_uri"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
# Max Body Size
client_max_body_size 10M;
}
......@@ -23,6 +23,19 @@ map $http_user_agent $prerender {
"~*discordbot" 1;
}
map $time_iso8601 $year {
default '0000';
"~^(\d{4})-(\d{2})-(\d{2})" $1;
}
map $time_iso8601 $month {
default '00';
"~^(\d{4})-(\d{2})-(\d{2})" $2;
}
map $time_iso8601 $day {
default '00';
"~^(\d{4})-(\d{2})-(\d{2})" $3;
}
server {
listen 8080 default_server;
......@@ -42,6 +55,14 @@ server {
proxy_pass https://data.grandlyon.com/fr/datapusher/ws/grandlyon/adr_voie_lieu.adrcomgl/all.json;
}
# Persist logs for jeuAieAieIA
location /shared/jeuAieAieIA {
# Default log which is redirected to stdout (must be reset in this block because of "access_log" below)
access_log /var/log/nginx/access.log main;
# And also write to a daily file
access_log /usr/share/nginx/html/shared/jeuAieAieIA/stats/log/access.$year-$month-$day.log main;
}
location / {
add_header X-Frame-Options SAMEORIGIN always;
add_header X-Content-Type-Options nosniff;
......
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