From 9ffe96204379d3a93eecaeedc362bf3ab7630440 Mon Sep 17 00:00:00 2001 From: fro Date: Sun, 2 Nov 2025 06:11:49 -0500 Subject: [PATCH] + antijanteboka.com.conf --- cfg/ngx/antijanteboka.com.conf | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 cfg/ngx/antijanteboka.com.conf diff --git a/cfg/ngx/antijanteboka.com.conf b/cfg/ngx/antijanteboka.com.conf new file mode 100644 index 0000000..56bad39 --- /dev/null +++ b/cfg/ngx/antijanteboka.com.conf @@ -0,0 +1,53 @@ +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# configuration of antijanteboka.com / 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 antijanteboka.com www.antijanteboka.com; + 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/antijanteboka.com/fullchain.pem; + ssl_certificate_key /etc/nginx/acme.sh/antijanteboka.com/key.pem; + ssl_trusted_certificate /etc/nginx/acme.sh/antijanteboka.com/cert.pem; + + server_name www.antijanteboka.com; + return 301 $scheme://antijanteboka.com$request_uri; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + + ssl_certificate /etc/nginx/acme.sh/antijanteboka.com/fullchain.pem; + ssl_certificate_key /etc/nginx/acme.sh/antijanteboka.com/key.pem; + ssl_trusted_certificate /etc/nginx/acme.sh/antijanteboka.com/cert.pem; + + # old: https://antijanteboka.com/antijantepodden_ajp089.html + # new: https://ajp.fm/.ep_ajp089.html + rewrite ^/antijantepodden\_ajp(.*)\.html$ https://ajp.fm/.ep_ajp$1.html last; + + root /var/www/antijanteboka.com/jongleur; + index index.html; + server_name antijanteboka.com; + + # redirect 404 not found to the root + location / { + error_page 404 = @myownredirect; + } + + location @myownredirect { + return 302 /; + } + +}