summaryrefslogtreecommitdiff
path: root/playbooks.d/webserver-nginx
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-05-10 09:30:51 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-05-10 09:30:51 +0200
commit55e6c6d2150fca97272cff6e874a8e3d8b8cd000 (patch)
tree19ba4ce2115c1948ff4e3866263b796e90b76e97 /playbooks.d/webserver-nginx
parentdb3b14c800db5cfe18896d57f47bdccbea393196 (diff)
Try different setup for the goaccess websocket
Diffstat (limited to 'playbooks.d/webserver-nginx')
-rw-r--r--playbooks.d/webserver-nginx/share/goaccess.service2
-rw-r--r--playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil7
-rw-r--r--playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil.www2
3 files changed, 9 insertions, 2 deletions
diff --git a/playbooks.d/webserver-nginx/share/goaccess.service b/playbooks.d/webserver-nginx/share/goaccess.service
index 2474991..d278145 100644
--- a/playbooks.d/webserver-nginx/share/goaccess.service
+++ b/playbooks.d/webserver-nginx/share/goaccess.service
@@ -13,7 +13,7 @@ PermissionsStartOnly=true
ExecStartPre=mkdir -p -- /run/goaccess
ExecStartPre=chown -- www-data:www-data /run/goaccess
ExecStartPre=chmod -- 0740 /run/goaccess
-ExecStart = sh -c "goaccess -a -f /var/log/nginx/access/%i/* -o /run/goaccess/%i.html --real-time-html --ws-url %i"
+ExecStart = sh -c "goaccess -a -f /var/log/nginx/access/%i/* -o /run/goaccess/%i.html --real-time-html --ws-url wss://%i:443/goaccess-ws --socket 7890"
[Install]
WantedBy = multi-user.target
diff --git a/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil b/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil
index f80c4b6..0551c3a 100644
--- a/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil
+++ b/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil
@@ -18,6 +18,13 @@ server {
try_files $1 =404;
}
+ location /goaccess-ws {
+ proxy_pass http://localhost:7890;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "Upgrade";
+ }
+
location / {
return 301 https://www.tyil.nl$request_uri;
}
diff --git a/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil.www b/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil.www
index f0c8aeb..e9fa693 100644
--- a/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil.www
+++ b/playbooks.d/webserver-nginx/share/sites.d/https/nl.tyil.www
@@ -24,7 +24,7 @@ server {
# GoAccess
location /analytics {
- add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src wss://tyil.nl:7890"
+ add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src wss://tyil.nl:443"
alias /run/goaccess;
try_files /tyil.nl.html =404;