From 3772e910df00a0a2e938cf19c3f24bb935c6a155 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 12 Feb 2026 20:12:18 +0000 Subject: [PATCH] fixup after testing to get a minimalistic working config --- install/sample-nginx.conf | 41 ++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/install/sample-nginx.conf b/install/sample-nginx.conf index a7bc26e63..4abd28b2c 100644 --- a/install/sample-nginx.conf +++ b/install/sample-nginx.conf @@ -1,21 +1,24 @@ server { + server_name hub.example.org; + listen 80; listen [::]:80; - server_name hub.example.org; return 301 https://$host$request_uri; } server { + server_name hub.example.org; + listen 443 ssl; listen [::]:443 ssl; http2 on; ## Quic and HTTP3 Requires Nginx >= 1.25.0 ## https://nginx.org/en/docs/quic.html - # listen [::]:443 quic; - # listen 443 quic; + # listen [::]:443 quic reuseport; + # listen 443 quic reuseport; # http3 on; - # server_name hub.example.org; + ## Headers for Quic and HTTP3 # add_header alt-svc 'h3=":443"; ma=86400' always; @@ -29,31 +32,20 @@ server { ## Basic folder and files settings root /var/www/hub.example.org; index index.php; - charset utf-8; - ## Access and Error logs - access_log off; - # reduce I/0 with buffer=10m flush=5m; - access_log /var/log/nginx/hub.example.org.log quic buffer=10m flush=5m; - error_log /var/log/nginx/hub.example.org.log error; - - ## Log to systemd log - # access_log syslog:server=unix:/dev/log quic; - error_log syslog:server=unix:/dev/log error; - - client_max_body_size 20m; # How big files are users allowed to upload + ## How big files are users allowed to upload + client_max_body_size 20m; client_body_buffer_size 128k; include mime.types; location / { - try_files $uri $uri/ /index.php?q=$uri; + try_files $uri /index.php?q=$uri&$args; } location ^~ /.well-known/ { allow all; - access_log off; - try_files $uri $uri/ /index.php?q=$uri; + try_files $uri /index.php?q=$uri&$args; } location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ { @@ -70,7 +62,12 @@ server { fastcgi_param HTTPS $https; } - # block hidden files, extensions, and directories - location ~* \.(bak|tpl|md|tgz|log|out)$ { deny all; access_log off;} - location ~* /(?:\.git|store|util)(?:/|$) { deny all; access_log off;} + ## block hidden files, extensions, and directories + location ~* \.(bak|tpl|md|tgz|log|out)$ { + deny all; + } + + location ~* /(?:\.git|store|util)(?:/|$) { + deny all; + } }