File tree 5 files changed +34
-5
lines changed
5 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ ENV SUPPRESS_NO_CONFIG_WARNING=1 \
20
20
21
21
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
22
22
&& apt-get update \
23
- && apt-get install -y --no-install-recommends jq \
23
+ && apt-get install -y --no-install-recommends jq logrotate \
24
24
&& apt-get clean \
25
25
&& rm -rf /var/lib/apt/lists/*
26
26
@@ -43,6 +43,9 @@ COPY docker/rootfs /
43
43
# Remove frontend service not required for prod, dev nginx config as well
44
44
RUN rm -rf /etc/services.d/frontend /etc/nginx/conf.d/dev.conf
45
45
46
+ # Change permission of logrotate config file
47
+ RUN chmod 644 /etc/logrotate.d/nginx-proxy-manager
48
+
46
49
VOLUME [ "/data" , "/etc/letsencrypt" ]
47
50
ENTRYPOINT [ "/init" ]
48
51
HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ ENV S6_LOGGING=0 \
7
7
8
8
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
9
9
&& apt-get update \
10
- && apt-get install -y certbot jq python3-pip \
10
+ && apt-get install -y certbot jq python3-pip logrotate \
11
11
&& apt-get clean \
12
12
&& rm -rf /var/lib/apt/lists/*
13
13
@@ -18,6 +18,7 @@ RUN cd /usr \
18
18
19
19
COPY rootfs /
20
20
RUN rm -f /etc/nginx/conf.d/production.conf
21
+ RUN chmod 644 /etc/logrotate.d/nginx-proxy-manager
21
22
22
23
# s6 overlay
23
24
RUN curl -L -o /tmp/s6-overlay-amd64.tar.gz "https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-amd64.tar.gz" \
Original file line number Diff line number Diff line change
1
+ /data/logs/*_access.log /data/logs/*/*_access.log {
2
+ create 0644 root root
3
+ weekly
4
+ rotate 4
5
+ missingok
6
+ notifempty
7
+ compress
8
+ sharedscripts
9
+ postrotate
10
+ /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
11
+ endscript
12
+ }
13
+
14
+ /data/logs/*_error.log /data/logs/*/*_error.log {
15
+ create 0644 root root
16
+ weekly
17
+ rotate 10
18
+ missingok
19
+ notifempty
20
+ compress
21
+ sharedscripts
22
+ postrotate
23
+ /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
24
+ endscript
25
+ }
Original file line number Diff line number Diff line change 8
8
set $port "80";
9
9
10
10
server_name localhost-nginx-proxy-manager;
11
- access_log /data/logs/fallback-access .log standard;
11
+ access_log /data/logs/fallback_access .log standard;
12
12
error_log /dev/null crit;
13
13
include conf.d/include/assets.conf;
14
14
include conf.d/include/block-exploits.conf;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ worker_processes auto;
9
9
# Enables the use of JIT for regular expressions to speed-up their processing.
10
10
pcre_jit on;
11
11
12
- error_log /data/logs/fallback-error .log warn ;
12
+ error_log /data/logs/fallback_error .log warn ;
13
13
14
14
# Includes files with directives to load dynamic modules.
15
15
include /etc/nginx/modules/*.conf;
46
46
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 "' ;
47
47
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 "' ;
48
48
49
- access_log /data/logs/fallback-access .log proxy;
49
+ access_log /data/logs/fallback_access .log proxy;
50
50
51
51
# Dynamically generated resolvers file
52
52
include /etc/nginx/conf.d/include/resolvers.conf;
You can’t perform that action at this time.
0 commit comments