File tree Expand file tree Collapse file tree 5 files changed +34
-5
lines changed Expand file tree Collapse file tree 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 \
2020
2121RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
2222 && apt-get update \
23- && apt-get install -y --no-install-recommends jq \
23+ && apt-get install -y --no-install-recommends jq logrotate \
2424 && apt-get clean \
2525 && rm -rf /var/lib/apt/lists/*
2626
@@ -43,6 +43,9 @@ COPY docker/rootfs /
4343# Remove frontend service not required for prod, dev nginx config as well
4444RUN rm -rf /etc/services.d/frontend /etc/nginx/conf.d/dev.conf
4545
46+ # Change permission of logrotate config file
47+ RUN chmod 644 /etc/logrotate.d/nginx-proxy-manager
48+
4649VOLUME [ "/data" , "/etc/letsencrypt" ]
4750ENTRYPOINT [ "/init" ]
4851HEALTHCHECK --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 \
77
88RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
99 && apt-get update \
10- && apt-get install -y certbot jq python3-pip \
10+ && apt-get install -y certbot jq python3-pip logrotate \
1111 && apt-get clean \
1212 && rm -rf /var/lib/apt/lists/*
1313
@@ -18,6 +18,7 @@ RUN cd /usr \
1818
1919COPY rootfs /
2020RUN rm -f /etc/nginx/conf.d/production.conf
21+ RUN chmod 644 /etc/logrotate.d/nginx-proxy-manager
2122
2223# s6 overlay
2324RUN 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 88 set $port "80";
99
1010 server_name localhost-nginx-proxy-manager;
11- access_log /data/logs/fallback-access .log standard;
11+ access_log /data/logs/fallback_access .log standard;
1212 error_log /dev/null crit;
1313 include conf.d/include/assets.conf;
1414 include conf.d/include/block-exploits.conf;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ worker_processes auto;
99# Enables the use of JIT for regular expressions to speed-up their processing.
1010pcre_jit on;
1111
12- error_log /data/logs/fallback-error .log warn;
12+ error_log /data/logs/fallback_error .log warn;
1313
1414# Includes files with directives to load dynamic modules.
1515include /etc/nginx/modules/*.conf;
4646 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"' ;
4747 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"' ;
4848
49- access_log /data/logs/fallback-access .log proxy;
49+ access_log /data/logs/fallback_access .log proxy;
5050
5151 # Dynamically generated resolvers file
5252 include /etc/nginx/conf.d/include /resolvers.conf;
You can’t perform that action at this time.
0 commit comments