From aff5a966c6cd7e52babdb8d34216ec44094575b6 Mon Sep 17 00:00:00 2001 From: Hikari Date: Tue, 3 Mar 2026 16:04:01 -0800 Subject: [PATCH] chore: remove unused default files and clean up comments Deletes conf.d/default.conf, snippets/snakeoil.conf, and snippets/fastcgi-php.conf (all stock example files not used in production). Strips all commented-out lines and the mail block from nginx.conf, and drops TLSv1/TLSv1.1 from ssl_protocols. Cleans sites-available/default down to just the functional catch-all. --- nginx/nginx/conf.d/default.conf | 44 --------------- nginx/nginx/nginx.conf | 36 +----------- nginx/nginx/sites-available/default | 81 ++------------------------- nginx/nginx/snippets/fastcgi-php.conf | 13 ----- nginx/nginx/snippets/snakeoil.conf | 5 -- 5 files changed, 5 insertions(+), 174 deletions(-) delete mode 100644 nginx/nginx/conf.d/default.conf delete mode 100644 nginx/nginx/snippets/fastcgi-php.conf delete mode 100644 nginx/nginx/snippets/snakeoil.conf diff --git a/nginx/nginx/conf.d/default.conf b/nginx/nginx/conf.d/default.conf deleted file mode 100644 index ff2ced6..0000000 --- a/nginx/nginx/conf.d/default.conf +++ /dev/null @@ -1,44 +0,0 @@ -server { - listen 80; - server_name localhost; - - #access_log /var/log/nginx/host.access.log main; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - } - - #error_page 404 /404.html; - - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - # proxy the PHP scripts to Apache listening on 127.0.0.1:80 - # - #location ~ \.php$ { - # proxy_pass http://127.0.0.1; - #} - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - # - #location ~ \.php$ { - # root html; - # fastcgi_pass 127.0.0.1:9000; - # fastcgi_index index.php; - # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; - # include fastcgi_params; - #} - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} -} - diff --git a/nginx/nginx/nginx.conf b/nginx/nginx/nginx.conf index 1487f29..9ec670c 100644 --- a/nginx/nginx/nginx.conf +++ b/nginx/nginx/nginx.conf @@ -5,7 +5,6 @@ include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; - # multi_accept on; } http { @@ -18,10 +17,6 @@ http { tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; - # server_tokens off; - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; @@ -30,7 +25,7 @@ http { # SSL Settings ## - ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE + ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; ## @@ -46,13 +41,6 @@ http { gzip on; - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - ## # Virtual Host Configs ## @@ -62,25 +50,3 @@ http { # Look at the real IP, not the cloudflare IP. include /etc/nginx/cloudflare_ips.conf; } - - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#} diff --git a/nginx/nginx/sites-available/default b/nginx/nginx/sites-available/default index c5af914..4876607 100644 --- a/nginx/nginx/sites-available/default +++ b/nginx/nginx/sites-available/default @@ -1,91 +1,18 @@ -## -# You should look at the following URL's in order to grasp a solid understanding -# of Nginx configuration files in order to fully unleash the power of Nginx. -# https://www.nginx.com/resources/wiki/start/ -# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ -# https://wiki.debian.org/Nginx/DirectoryStructure -# -# In most cases, administrators will remove this file from sites-enabled/ and -# leave it as reference inside of sites-available where it will continue to be -# updated by the nginx packaging team. -# -# This file will automatically load configuration files provided by other -# applications, such as Drupal or Wordpress. These applications will be made -# available underneath a path with that package name, such as /drupal8. -# -# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. -## - -# Default server configuration -# server { listen 80 default_server; listen [::]:80 default_server; - # SSL configuration - # - # listen 443 ssl default_server; - # listen [::]:443 ssl default_server; - # - # Note: You should disable gzip for SSL traffic. - # See: https://bugs.debian.org/773332 - # - # Read up on ssl_ciphers to ensure a secure configuration. - # See: https://bugs.debian.org/765782 - # - # Self signed certs generated by the ssl-cert package - # Don't use them in a production server! - # - # include snippets/snakeoil.conf; - root /var/www/html; - - # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name _; location / { - # First attempt to serve request as file, then - # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } - # pass PHP scripts to FastCGI server - # - #location ~ \.php$ { - # include snippets/fastcgi-php.conf; - # - # # With php-fpm (or other unix sockets): - # fastcgi_pass unix:/run/php/php7.4-fpm.sock; - # # With php-cgi (or other tcp sockets): - # fastcgi_pass 127.0.0.1:9000; - #} - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } } - - -# Virtual Host configuration for example.com -# -# You can move that to a different file under sites-available/ and symlink that -# to sites-enabled/ to enable it. -# -#server { -# listen 80; -# listen [::]:80; -# -# server_name example.com; -# -# root /var/www/example.com; -# index index.html; -# -# location / { -# try_files $uri $uri/ =404; -# } -#} diff --git a/nginx/nginx/snippets/fastcgi-php.conf b/nginx/nginx/snippets/fastcgi-php.conf deleted file mode 100644 index 467a9e7..0000000 --- a/nginx/nginx/snippets/fastcgi-php.conf +++ /dev/null @@ -1,13 +0,0 @@ -# regex to split $uri to $fastcgi_script_name and $fastcgi_path -fastcgi_split_path_info ^(.+?\.php)(/.*)$; - -# Check that the PHP script exists before passing it -try_files $fastcgi_script_name =404; - -# Bypass the fact that try_files resets $fastcgi_path_info -# see: http://trac.nginx.org/nginx/ticket/321 -set $path_info $fastcgi_path_info; -fastcgi_param PATH_INFO $path_info; - -fastcgi_index index.php; -include fastcgi.conf; diff --git a/nginx/nginx/snippets/snakeoil.conf b/nginx/nginx/snippets/snakeoil.conf deleted file mode 100644 index ad26c3e..0000000 --- a/nginx/nginx/snippets/snakeoil.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Self signed certificates generated by the ssl-cert package -# Don't use them in a production server! - -ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; -ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;