Skip to content

Commit 6fa3084

Browse files
authored
Merge pull request #5114 from Shotz5/develop
Added logging for streams based on port
2 parents 05726aa + aeb4424 commit 6fa3084

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

backend/templates/stream.conf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ server {
1212

1313
proxy_pass {{ forwarding_host }}:{{ forwarding_port }};
1414

15+
access_log /data/logs/stream-{{ id }}_access.log stream;
16+
error_log /data/logs/stream-{{ id }}_error.log warn;
17+
1518
# Custom
1619
include /data/nginx/custom/server_stream[.]conf;
1720
include /data/nginx/custom/server_stream_tcp[.]conf;
@@ -25,9 +28,12 @@ server {
2528

2629
proxy_pass {{ forwarding_host }}:{{ forwarding_port }};
2730

31+
access_log /data/logs/stream-{{ id }}_access.log stream;
32+
error_log /data/logs/stream-{{ id }}_error.log warn;
33+
2834
# Custom
2935
include /data/nginx/custom/server_stream[.]conf;
3036
include /data/nginx/custom/server_stream_udp[.]conf;
3137
}
3238
{% endif %}
33-
{% endif %}
39+
{% endif %}

docker/rootfs/etc/nginx/conf.d/default.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ server {
88
set $port "80";
99

1010
server_name localhost-nginx-proxy-manager;
11-
access_log /data/logs/fallback_access.log standard;
12-
error_log /data/logs/fallback_error.log warn;
11+
access_log /data/logs/fallback_http_access.log standard;
12+
error_log /data/logs/fallback_http_error.log warn;
1313
include conf.d/include/assets.conf;
1414
include conf.d/include/block-exploits.conf;
1515
include conf.d/include/letsencrypt-acme-challenge.conf;
@@ -30,7 +30,7 @@ server {
3030
set $port "443";
3131

3232
server_name localhost;
33-
access_log /data/logs/fallback_access.log standard;
33+
access_log /data/logs/fallback_http_access.log standard;
3434
error_log /dev/null crit;
3535
include conf.d/include/ssl-ciphers.conf;
3636
ssl_reject_handshake on;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
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"';
22
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"';
33

4-
access_log /data/logs/fallback_access.log proxy;
4+
access_log /data/logs/fallback_http_access.log proxy;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
log_format stream '[$time_local] [Client $remote_addr:$remote_port] $protocol $status $bytes_sent $bytes_received $session_time [Sent-to $upstream_addr] [Sent $upstream_bytes_sent] [Received $upstream_bytes_received] [Time $upstream_connect_time] $ssl_protocol $ssl_cipher';
2+
3+
access_log /data/logs/fallback_stream_access.log stream;

docker/rootfs/etc/nginx/nginx.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ http {
4747
proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
4848

4949
# Log format and fallback log file
50-
include /etc/nginx/conf.d/include/log.conf;
50+
include /etc/nginx/conf.d/include/log-proxy.conf;
5151

5252
# Dynamically generated resolvers file
5353
include /etc/nginx/conf.d/include/resolvers.conf;
@@ -85,6 +85,9 @@ http {
8585
}
8686

8787
stream {
88+
# Log format and fallback log file
89+
include /etc/nginx/conf.d/include/log-stream.conf;
90+
8891
# Files generated by NPM
8992
include /data/nginx/stream/*.conf;
9093

0 commit comments

Comments
 (0)