File tree Expand file tree Collapse file tree 4 files changed +20
-7
lines changed
Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,15 @@ RUN apt-get update && apt-get install -y \
1313 ca-certificates \
1414 wget \
1515 curl \
16- nginx \
16+ gnupg2 \
17+ debian-archive-keyring \
1718 unzip \
1819 certbot \
20+ && curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \
21+ && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/mainline/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list \
22+ && printf "Package: *\n Pin: origin nginx.org\n Pin: release o=nginx\n Pin-Priority: 900\n " > /etc/apt/preferences.d/99nginx \
23+ && apt-get update \
24+ && apt-get install -y nginx \
1925 && ARCH=$(uname -m) \
2026 && if [ "$ARCH" = "x86_64" ]; then \
2127 wget -O /tmp/cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb; \
Original file line number Diff line number Diff line change @@ -59,4 +59,4 @@ echo -e "\033[1;36mSee the LICENSE file for details.\033[0m"
5959echo -e " \033[0;34m───────────────────────────────────────────────\033[0m"
6060
6161# Start NGINX
62- nginx -c " $NGINX_CONF " -p " $NGINX_PREFIX "
62+ nginx -c " $NGINX_CONF " -p " $NGINX_PREFIX " -e /dev/stderr
Original file line number Diff line number Diff line change @@ -2,8 +2,13 @@ server {
22 listen 80;
33 server_name "";
44
5- access_log /home/container/logs/naccess.log;
6- error_log /home/container/logs/nerror.log error;
5+ # Commented out due to this overriding existing configuration already set in nginx/nginx.conf
6+ # access_log /home/container/logs/naccess.log;
7+ # error_log /home/container/logs/nerror.log error;
8+
9+ set_real_ip_from 127.0.0.1;
10+ real_ip_header CF-Connecting-IP;
11+ real_ip_recursive on;
712
813 root /home/container/www;
914 index index.html index.htm index.php;
@@ -18,10 +23,12 @@ server {
1823
1924 location = /favicon.ico { access_log off; log_not_found off; }
2025 location = /robots.txt { access_log off; log_not_found off; }
26+
2127 # allow larger file uploads and longer script runtimes
2228 client_max_body_size 100m;
2329 client_body_timeout 120s;
2430 sendfile off;
31+
2532 location ~ \.php$ {
2633 fastcgi_split_path_info ^(.+\.php)(/.+)$;
2734 try_files $fastcgi_script_name =404;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ worker_processes auto;
22pid /home/container/tmp/nginx.pid ;
33include /home/container/modules-enabled/*.conf;
44error_log /home/container/logs/error.log;
5- error_log /dev/stdout ;
5+ error_log /dev/stderr ;
66daemon off;
77
88events {
4646 scgi_temp_path /home/container/tmp;
4747 fastcgi_temp_path /home/container/tmp;
4848 access_log /home/container/logs/access.log;
49- access_log /dev/stdout;
49+ # access_log /dev/stdout; # Console access log works but spammy up to you to decide whether to enable or not
5050 error_log /home/container/logs/error.log;
51- error_log /dev/stdout ;
51+ error_log /dev/stderr ;
5252
5353 ##
5454 # Gzip Settings
You can’t perform that action at this time.
0 commit comments