-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxy_patch.patch
129 lines (116 loc) · 7.45 KB
/
proxy_patch.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
diff -ruN backend/templates/dead_host.conf backend/templates/dead_host.conf
--- backend/templates/dead_host.conf 2021-12-31 17:16:38.621290171 +0100
+++ backend/templates/dead_host.conf 2021-12-31 16:45:24.264056285 +0100
@@ -7,8 +7,8 @@
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}
- access_log /data/logs/dead-host-{{ id }}_access.log standard;
- error_log /data/logs/dead-host-{{ id }}_error.log warn;
+# access_log /data/logs/dead-host-{{ id }}_access.log standard;
+# error_log /data/logs/dead-host-{{ id }}_error.log warn;
{{ advanced_config }}
diff -ruN backend/templates/default.conf backend/templates/default.conf
--- backend/templates/default.conf 2021-12-31 17:16:38.621290171 +0100
+++ backend/templates/default.conf 2021-12-31 16:45:46.063925660 +0100
@@ -12,8 +12,8 @@
#listen [::]:80 default;
{% endif %}
server_name default-host.localhost;
- access_log /data/logs/default-host_access.log combined;
- error_log /data/logs/default-host_error.log warn;
+# access_log /data/logs/default-host_access.log combined;
+# error_log /data/logs/default-host_error.log warn;
{% include "_exploits.conf" %}
include conf.d/include/letsencrypt-acme-challenge.conf;
diff -ruN backend/templates/proxy_host.conf backend/templates/proxy_host.conf
--- backend/templates/proxy_host.conf 2021-12-31 17:16:38.621290171 +0100
+++ backend/templates/proxy_host.conf 2021-12-31 16:46:03.051827790 +0100
@@ -19,8 +19,8 @@
proxy_http_version 1.1;
{% endif %}
- access_log /data/logs/proxy-host-{{ id }}_access.log proxy;
- error_log /data/logs/proxy-host-{{ id }}_error.log warn;
+# access_log /data/logs/proxy-host-{{ id }}_access.log proxy;
+# error_log /data/logs/proxy-host-{{ id }}_error.log warn;
{{ advanced_config }}
diff -ruN backend/templates/redirection_host.conf backend/templates/redirection_host.conf
--- backend/templates/redirection_host.conf 2021-12-31 17:16:38.621290171 +0100
+++ backend/templates/redirection_host.conf 2021-12-31 16:46:32.459666136 +0100
@@ -9,8 +9,8 @@
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}
- access_log /data/logs/redirection-host-{{ id }}_access.log standard;
- error_log /data/logs/redirection-host-{{ id }}_error.log warn;
+# access_log /data/logs/redirection-host-{{ id }}_access.log standard;
+# error_log /data/logs/redirection-host-{{ id }}_error.log warn;
{{ advanced_config }}
diff -ruN docker/rootfs/etc/logrotate.d/nginx-proxy-manager docker/rootfs/etc/logrotate.d/nginx-proxy-manager
--- docker/rootfs/etc/logrotate.d/nginx-proxy-manager 2024-02-26 19:14:18
+++ docker/rootfs/etc/logrotate.d/nginx-proxy-manager 2024-02-26 19:18:57
@@ -1,4 +1,4 @@
-/data/logs/*_access.log /data/logs/*/access.log {
+/data/logs/json_access.log /data/logs/*/access.log {
su npm npm
create 0644
weekly
@@ -24,4 +24,4 @@
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
-}
\ No newline at end of file
+}
diff -ruN docker/rootfs/etc/nginx/nginx.conf docker/rootfs/etc/nginx/nginx.conf
--- docker/rootfs/etc/nginx/nginx.conf 2021-12-31 17:16:38.625290172 +0100
+++ docker/rootfs/etc/nginx/nginx.conf 2021-12-31 16:43:53.408667047 +0100
@@ -43,10 +43,51 @@
proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m;
proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
- log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
+# log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';
- access_log /data/logs/fallback_access.log proxy;
+log_format json_analytics escape=json '{'
+ '"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution
+ '"connection": "$connection", ' # connection serial number
+ '"connection_requests": "$connection_requests", ' # number of requests made in connection
+ '"pid": "$pid", ' # process pid
+ '"request_id": "$request_id", ' # the unique request id
+ '"request_length": "$request_length", ' # request length (including headers and body)
+ '"remote_addr": "$remote_addr", ' # client IP
+ '"remote_user": "$remote_user", ' # client HTTP username
+ '"remote_port": "$remote_port", ' # client port
+ '"time_local": "$time_local", '
+ '"time_iso8601": "$time_iso8601", ' # local time in the ISO 8601 standard format
+ '"request": "$request", ' # full path no arguments if the request
+ '"request_uri": "$request_uri", ' # full path and arguments if the request
+ '"args": "$args", ' # args
+ '"status": "$status", ' # response status code
+ '"body_bytes_sent": "$body_bytes_sent", ' # the number of body bytes exclude headers sent to a client
+ '"bytes_sent": "$bytes_sent", ' # the number of bytes sent to a client
+ '"http_referer": "$http_referer", ' # HTTP referer
+ '"http_user_agent": "$http_user_agent", ' # user agent
+ '"http_x_forwarded_for": "$http_x_forwarded_for", ' # http_x_forwarded_for
+ '"http_host": "$http_host", ' # the request Host: header
+ '"server_name": "$server_name", ' # the name of the vhost serving the request
+ '"request_time": "$request_time", ' # request processing time in seconds with msec resolution
+ '"upstream": "$upstream_addr", ' # upstream backend server for proxied requests
+ '"upstream_connect_time": "$upstream_connect_time", ' # upstream handshake time incl. TLS
+ '"upstream_header_time": "$upstream_header_time", ' # time spent receiving upstream headers
+ '"upstream_response_time": "$upstream_response_time", ' # time spend receiving upstream body
+ '"upstream_response_length": "$upstream_response_length", ' # upstream response length
+ '"upstream_cache_status": "$upstream_cache_status", ' # cache HIT/MISS where applicable
+ '"ssl_protocol": "$ssl_protocol", ' # TLS protocol
+ '"ssl_cipher": "$ssl_cipher", ' # TLS cipher
+ '"scheme": "$scheme", ' # http or https
+ '"request_method": "$request_method", ' # request method
+ '"server_protocol": "$server_protocol", ' # request protocol, like HTTP/1.1 or HTTP/2.0
+ '"pipe": "$pipe", ' # "p" if request was pipelined, "." otherwise
+ '"gzip_ratio": "$gzip_ratio", '
+ '"http_cf_ray": "$http_cf_ray"'
+ '}';
+
+
+ access_log /data/logs/json_access.log json_analytics;
# Dynamically generated resolvers file
include /etc/nginx/conf.d/include/resolvers.conf;