-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathgoaccess.conf
70 lines (51 loc) · 1.93 KB
/
goaccess.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
map $http_upgrade $connection_upgrade {
default Upgrade;
'' close;
}
# @see https://bytes.fyi/real-time-goaccess-reports-with-nginx/
server {
set $goaccess_server goaccess:7890;
set $host_path /var/www/goaccess;
# Certification location
include snippets/ssl-certificates.conf;
# Strong TLS + TLS Best Practices
include snippets/ssl.conf;
# server listen (HTTPS)
listen 443 ssl http2;
server_name goaccess.yourdomain.tld;
# if you chose a different location for the webroot, use it here
root $host_path;
index report.html;
# # update to match your local network, to allow access from your LAN
# allow YOUR_IP;
# deny all; # block rest of the world
sendfile off;
open_file_cache off;
include snippets/no-caching.conf;
more_clear_headers Content-Security-Policy Feature-Policy;
location / {
try_files $uri/report.html$is_args$query_string =404;
}
error_log /var/log/nginx/error.stderr.log warn;
error_log /var/log/nginx/goaccess.error.log warn;
# access_log /var/log/nginx/access.stdout.log main_json;
access_log /var/log/nginx/goaccess.performance.access.log performance;
location /wss {
include snippets/resolver-docker.conf;
# Not working in cloudflare: https://community.cloudflare.com/t/cloudflare-websocket-timeout/5865
proxy_read_timeout 1d;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$goaccess_server;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_http_version 1.1;
# prevents 502 bad gateway error
proxy_buffers 8 32k;
proxy_buffer_size 64k;
reset_timedout_connection on;
}
}