Created
January 7, 2025 07:42
-
-
Save muhammadardie/6fb803490126205ef37bedd9589b3a16 to your computer and use it in GitHub Desktop.
GoAccess configuration using supervisord and nginx (Rocky Linux 9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:goaccess] | |
command=/usr/bin/goaccess /var/log/nginx/access.log -o /var/www/goaccess/index.html --log-format=COMBINED --real-time-html --tz=Asia/Jakarta --ws-url=wss://subdomain.example.com:443/wss --port 7890 | |
directory=/var/www/goaccess | |
environment=HOME="/root",USER="root" | |
autostart=true | |
autorestart=true | |
startretries=3 | |
user=root | |
redirect_stderr=true | |
stdout_logfile=/var/log/supervisor/goaccess.log | |
stdout_logfile_maxbytes=50MB | |
stdout_logfile_backups=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name subdomain.example.com; | |
# Redirect all HTTP requests to HTTPS | |
return 301 https://subdomain.example.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name subdomain.example.com; | |
root /var/www/goaccess; | |
# SSL Configuration | |
ssl_certificate /etc/letsencrypt/live/subdomain.example.com/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/subdomain.example.com/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
location / { | |
root /var/www/goaccess; | |
index index.html; | |
auth_basic "Restricted Access"; | |
auth_basic_user_file /etc/nginx/.htpasswd; | |
} | |
location /ws { | |
proxy_pass http://localhost:7890; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment