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,29 @@
upstream minio_backend {
server minio:9001;
# 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;
}
upstream s3_backend {
server minio:9000;
# 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;
}
server {
listen 80;
server_name minio.novicelab.io;
@@ -41,18 +67,18 @@ server {
add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always;
# Logging
access_log /var/log/nginx/minio.novicelab.io_access.log VCOMBINED;
access_log /var/log/nginx/minio.novicelab.io_access.log json_combined;
error_log /var/log/nginx/minio.novicelab.io_error.log debug;
# resolver 127.0.0.11 valid=30s;
set $minio_backend minio:9001;
# set $minio_backend minio:9001;
# if ($http_x_forwarded_proto != "https") {
# return 301 https://$host$request_uri;
# }
location / {
proxy_pass http://$minio_backend;
proxy_pass http://minio_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -74,6 +100,12 @@ server {
}
}
server {
listen 80;
server_name s3.novicelab.io;
return 301 https://$host$request_uri; # Redirect HTTP to HTTPS
}
server {
listen 443 ssl; #http2;
listen [::]:443 ssl; # http2;
@@ -107,14 +139,14 @@ server {
add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always;
# Logging
access_log /var/log/nginx/s3.novicelab.io_access.log VCOMBINED;
access_log /var/log/nginx/s3.novicelab.io_access.log json_combined;
error_log /var/log/nginx/s3.novicelab.io_error.log debug;
# resolver 127.0.0.11 valid=30s;
set $s3_backend minio:9000;
# set $s3_backend minio:9000;
location / {
proxy_pass http://$s3_backend;
proxy_pass http://s3_backend;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;