aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Potocki <dawid@dawidpotocki.com>2021-02-01 20:22:40 +1300
committerDawid Potocki <dawid@dawidpotocki.com>2021-02-01 20:32:13 +1300
commit034f56e4fdde4b189fca79a7823e0ace974ffdb4 (patch)
tree30b1863673c441e97a3cf91b0c6f64dbb0d9acc1
parent6e4aa761efbd6a4475150cbe8f4694fc4c5767e3 (diff)
Put nginx logs in a separate file
-rw-r--r--nginx/000-main.conf5
-rw-r--r--nginx/040-logs.conf4
2 files changed, 9 insertions, 0 deletions
diff --git a/nginx/000-main.conf b/nginx/000-main.conf
index e425e49..90c9aff 100644
--- a/nginx/000-main.conf
+++ b/nginx/000-main.conf
@@ -9,6 +9,8 @@ server {
if ($host = {{ site.mail_domain }}) { return 301 https://{{ site.domain }}/mail$request_uri; }
if ($host = {{ site.domain }}) { return 301 https://$host$request_uri; }
+ include /var/www/{{ site.domain }}/nginx/040-logs.conf;
+
return 404;
}
@@ -27,12 +29,14 @@ server {
location ~ ^/.well-known/matrix/(client|server) {
more_set_headers Content-Type application/json;
add_header Access-Control-Allow-Origin *;
+ access_log off; error_log off;
}
location / { try_files $uri $uri/ =404; }
include /var/www/{{ site.domain }}/nginx/010-headers.conf;
include /var/www/{{ site.domain }}/nginx/020-tls.conf;
include /var/www/{{ site.domain }}/nginx/030-error.conf;
+ include /var/www/{{ site.domain }}/nginx/040-logs.conf;
}
@@ -49,4 +53,5 @@ server {
include /var/www/{{ site.domain }}/nginx/010-headers.conf;
include /var/www/{{ site.domain }}/nginx/030-error.conf;
+ include /var/www/{{ site.domain }}/nginx/040-logs.conf;
}
diff --git a/nginx/040-logs.conf b/nginx/040-logs.conf
new file mode 100644
index 0000000..faeca09
--- /dev/null
+++ b/nginx/040-logs.conf
@@ -0,0 +1,4 @@
+---
+---
+access_log /var/log/nginx/{{ site.domain }}--access.log;
+error_log /var/log/nginx/{{ site.domain }}--error.log;