From b716027bb6805da7747eebfe523a715ca2e068c7 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Fri, 3 Jan 2025 16:06:22 -0800 Subject: [PATCH] simplify module loading --- conf.d/stream.conf | 14 -------------- modules/10_stream.conf | 2 +- nginx.conf | 2 +- proxy-params.conf | 1 - snippets/proxy-errors.conf | 2 +- ssl-params.conf | 1 - 6 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 conf.d/stream.conf diff --git a/conf.d/stream.conf b/conf.d/stream.conf deleted file mode 100644 index 4b7177d..0000000 --- a/conf.d/stream.conf +++ /dev/null @@ -1,14 +0,0 @@ -# /etc/nginx/conf.d/stream.conf - -stream { - # Specifies the main log format. - log_format main '$remote_addr [$time_local] ' - '$protocol $status $bytes_sent $bytes_received ' - '$session_time "$upstream_addr" ' - '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; - - access_log /var/log/nginx/stream.log main; - - # Includes servers configs. - include stream.d/*.conf; -} diff --git a/modules/10_stream.conf b/modules/10_stream.conf index 9b0cbc3..6b60790 100644 --- a/modules/10_stream.conf +++ b/modules/10_stream.conf @@ -1 +1 @@ -load_module "modules/ngx_stream_module.so"; +load_module "/usr/lib/nginx/modules/ngx_stream_module.so"; diff --git a/nginx.conf b/nginx.conf index bc61f66..107dae3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,7 +1,7 @@ user nginx; worker_processes auto; pcre_jit on; -load_module /usr/lib/nginx/modules/ngx_stream_module.so; +include modules/*.conf; events { worker_connections 768; } diff --git a/proxy-params.conf b/proxy-params.conf index 2b0c10d..d841985 100644 --- a/proxy-params.conf +++ b/proxy-params.conf @@ -10,7 +10,6 @@ send_timeout 3600s; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; - proxy_hide_header X-Powered-By; proxy_hide_header X-Frame-Options; add_header X-Frame-Options SAMEORIGIN; diff --git a/snippets/proxy-errors.conf b/snippets/proxy-errors.conf index 8c4c12f..946058f 100644 --- a/snippets/proxy-errors.conf +++ b/snippets/proxy-errors.conf @@ -6,4 +6,4 @@ error_page 404 /ErrorPages/HTTP404.html; error_page 500 /ErrorPages/HTTP500.html; error_page 501 /ErrorPages/HTTP501.html; error_page 502 /ErrorPages/HTTP502.html; -error_page 503 /ErrorPages/HTTP503.html; \ No newline at end of file +error_page 503 /ErrorPages/HTTP503.html; diff --git a/ssl-params.conf b/ssl-params.conf index af97e4c..3ab1c75 100644 --- a/ssl-params.conf +++ b/ssl-params.conf @@ -10,7 +10,6 @@ ssl_stapling_verify on; resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 5s; ssl_dhparam /etc/ssl/certs/dhparam.pem; - # ssl cert paths ssl_certificate /etc/letsencrypt/live/tronnet.net/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/tronnet.net/privkey.pem;