Skip to content

Commit 8d566da

Browse files
authored
Merge pull request #62 from Frerduro/patch-2
Update NGINX installation from v1.22.1 to 1.29.8 + QOL
2 parents 0fe85e2 + a6ab8ca commit 8d566da

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-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; \

modules/nginx/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ echo -e "\033[1;36mSee the LICENSE file for details.\033[0m"
5959
echo -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

nginx/conf.d/default.conf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

nginx/nginx.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ worker_processes auto;
22
pid /home/container/tmp/nginx.pid;
33
include /home/container/modules-enabled/*.conf;
44
error_log /home/container/logs/error.log;
5-
error_log /dev/stdout;
5+
error_log /dev/stderr;
66
daemon off;
77

88
events {
@@ -46,9 +46,9 @@ http {
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

0 commit comments

Comments
 (0)