fixup after testing to get a minimalistic working config

This commit is contained in:
Mario
2026-02-12 20:12:18 +00:00
parent e995d45b53
commit 3772e910df

View File

@@ -1,21 +1,24 @@
server { server {
server_name hub.example.org;
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name hub.example.org;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
server { server {
server_name hub.example.org;
listen 443 ssl; listen 443 ssl;
listen [::]:443 ssl; listen [::]:443 ssl;
http2 on; http2 on;
## Quic and HTTP3 Requires Nginx >= 1.25.0 ## Quic and HTTP3 Requires Nginx >= 1.25.0
## https://nginx.org/en/docs/quic.html ## https://nginx.org/en/docs/quic.html
# listen [::]:443 quic; # listen [::]:443 quic reuseport;
# listen 443 quic; # listen 443 quic reuseport;
# http3 on; # http3 on;
# server_name hub.example.org;
## Headers for Quic and HTTP3 ## Headers for Quic and HTTP3
# add_header alt-svc 'h3=":443"; ma=86400' always; # add_header alt-svc 'h3=":443"; ma=86400' always;
@@ -29,31 +32,20 @@ server {
## Basic folder and files settings ## Basic folder and files settings
root /var/www/hub.example.org; root /var/www/hub.example.org;
index index.php; index index.php;
charset utf-8;
## Access and Error logs ## How big files are users allowed to upload
access_log off; client_max_body_size 20m;
# 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
client_body_buffer_size 128k; client_body_buffer_size 128k;
include mime.types; include mime.types;
location / { location / {
try_files $uri $uri/ /index.php?q=$uri; try_files $uri /index.php?q=$uri&$args;
} }
location ^~ /.well-known/ { location ^~ /.well-known/ {
allow all; allow all;
access_log off; try_files $uri /index.php?q=$uri&$args;
try_files $uri $uri/ /index.php?q=$uri;
} }
location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ { location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ {
@@ -70,7 +62,12 @@ server {
fastcgi_param HTTPS $https; fastcgi_param HTTPS $https;
} }
# block hidden files, extensions, and directories ## block hidden files, extensions, and directories
location ~* \.(bak|tpl|md|tgz|log|out)$ { deny all; access_log off;} location ~* \.(bak|tpl|md|tgz|log|out)$ {
location ~* /(?:\.git|store|util)(?:/|$) { deny all; access_log off;} deny all;
}
location ~* /(?:\.git|store|util)(?:/|$) {
deny all;
}
} }