From 3032b01843f9f9323c5d02456d9fea9c3079426a Mon Sep 17 00:00:00 2001 From: fro Date: Sat, 1 Nov 2025 19:03:03 -0500 Subject: [PATCH] + ajp.fm.conf --- cfg/ngx/ajp.fm.conf | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 cfg/ngx/ajp.fm.conf diff --git a/cfg/ngx/ajp.fm.conf b/cfg/ngx/ajp.fm.conf new file mode 100644 index 0000000..17dfb48 --- /dev/null +++ b/cfg/ngx/ajp.fm.conf @@ -0,0 +1,49 @@ +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# configuration of 00101111.xyz / frode klevstul / oct 2025 +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# - - - - - - - - - - - - - - - - - - - + +# enforce ssl and bare domain (without www) for http requests +# ($server_name will return the first value given) +server { + listen 80; + server_name ajp.fm www.ajp.fm; + return 301 https://$server_name$request_uri; +} + +# www to bare domain for https requests +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + + ssl_certificate /etc/nginx/acme.sh/ajp.fm/fullchain.pem; + ssl_certificate_key /etc/nginx/acme.sh/ajp.fm/key.pem; + ssl_trusted_certificate /etc/nginx/acme.sh/ajp.fm/cert.pem; + + server_name www.ajp.fm; + return 301 $scheme://ajp.fm$request_uri; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + + ssl_certificate /etc/nginx/acme.sh/ajp.fm/fullchain.pem; + ssl_certificate_key /etc/nginx/acme.sh/ajp.fm/key.pem; + ssl_trusted_certificate /etc/nginx/acme.sh/ajp.fm/cert.pem; + + root /var/www/ajp.fm/jongleur; + index index.html; + server_name ajp.fm; + + # redirect 404 not found to the root + location / { + error_page 404 = @myownredirect; + } + + location @myownredirect { + return 302 /; + } +}