Set access log format and Upstream

Set access log format to json_combined
Switch from $backend_variable to upstream
(Except for harbor, plane-minio, goaccess, opencloud)
This commit is contained in:
2026-03-17 18:06:10 +00:00
parent 50b13c34ef
commit 547701c7da
13 changed files with 284 additions and 52 deletions

View File

@@ -1,3 +1,16 @@
upstream umami_backend {
server umami:3000;
# Keep up to 32 idle connections per worker
keepalive 16;
# Maximum time a connection can be idle
keepalive_timeout 60s;
# Maximum requests per keepalive connection
keepalive_requests 100;
}
# # Redirect HTTP to HTTPS
server {
listen 80;
@@ -62,7 +75,7 @@ server {
# ssl_dhparam /etc/nginx/ssl/dhparam.pem;
# Logging
access_log /var/log/nginx/umami.novicelab.io_access.log VCOMBINED;
access_log /var/log/nginx/umami.novicelab.io_access.log json_combined;
error_log /var/log/nginx/umami.novicelab.io_error.log debug;
# Root and index
@@ -70,11 +83,12 @@ server {
# index index.html index.htm;
# include /etc/letsencrypt/options-ssl-nginx.conf;
set $umami_backend umami:3000;
# set $umami_backend umami:3000;
location / {
# proxy_pass http://10.0.0.251:9200/;
proxy_pass http://$umami_backend;
# proxy_pass http://$umami_backend;
proxy_pass http://umami_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -90,7 +104,8 @@ server {
}
# 1. Allow public access to tracking scripts
location ~ ^/(script\.js|umami\.js)$ {
proxy_pass http://$umami_backend;
# proxy_pass http://$umami_backend;
proxy_pass http://umami_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -107,7 +122,8 @@ server {
# 2. Allow public access to tracking API (metrics collection)
location /api/send {
proxy_pass http://$umami_backend;
# proxy_pass http://$umami_backend;
proxy_pass http://umami_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;