Limit log to certain file types
This commit is contained in:
parent
4b17d66ed4
commit
e54bc97477
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
# privacy-aware log format
|
# privacy-aware log format
|
||||||
log_format custom '$remote_addr_anon - - [$time_local] "$request" $status $body_bytes_sent "-" "$http_user_agent"';
|
log_format custom '$remote_addr_anon - - [$time_local] "$request" $status $body_bytes_sent "-" "$http_user_agent"';
|
||||||
access_log /var/log/nginx/access.log custom;
|
access_log off;
|
||||||
|
|
||||||
map $remote_addr $remote_addr_anon {
|
map $remote_addr $remote_addr_anon {
|
||||||
~(?P<ip>\d+\.\d+)\. $ip.0.0;
|
~(?P<ip>\d+\.\d+)\. $ip.0.0;
|
||||||
|
@ -38,6 +38,13 @@
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
root = "/var/www/";
|
root = "/var/www/";
|
||||||
|
|
||||||
|
# only log page views, rss feed access, media file download and embed views
|
||||||
|
extraConfig = ''
|
||||||
|
location ~ index\.html|rss\.xml|\.(opus|m4a|ogg|mp3|\.podlove.json)$ {
|
||||||
|
access_log /var/log/nginx/access.log custom;
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
"www.${config.deployment.targetHost}" = {
|
"www.${config.deployment.targetHost}" = {
|
||||||
|
|
Loading…
Reference in a new issue