add nginx.conf logging option
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
2025-04-23 10:13:42 +01:00
parent 6dbcb88857
commit a947004e54
2 changed files with 69 additions and 2 deletions
+26 -2
View File
@@ -4,7 +4,7 @@ events { worker_connections 1024; }
http {
sendfile on;
client_max_body_size 500M;
client_max_body_size 1500M;
server_names_hash_bucket_size 1024;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Scheme $scheme;
@@ -20,6 +20,8 @@ http {
gzip on;
gzip_types text/plain application/xml application/json image/svg+xml text/css;
gzip_min_length 1000;
log_format my_custom_format '$http_host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
server {
@@ -40,7 +42,7 @@ http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
}
include /etc/nginx/conf.d/*.conf;
resolver 127.0.0.1 ipv6=off valid=40s; # The DNS IP server
@@ -48,6 +50,28 @@ http {
#https://www.tweaked.io/guide/nginx-proxying/
proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache:60m max_size=1G;
# log_format main '$remote_addr - $remote_user [$time_local] '
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent" "$gzip_ratio"'
# 'host - $host '
# '$scheme $proxy_add_x_forwarded_for '
# '$remote_addr [$time_local]'
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent"'
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent" "$gzip_ratio"';
# log_format upstream_time '$remote_addr - $remote_user [$time_local] '
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent"'
# 'host + $host '
# '$scheme $proxy_add_x_forwarded_for '
# '$remote_addr [$time_local]'
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent"'
# 'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
}