From 03a580b12086420b249af043524588f47b5d632e Mon Sep 17 00:00:00 2001 From: fro Date: Wed, 29 Oct 2025 03:01:59 -0500 Subject: [PATCH] + fw.op.fo.conf --- cfg/ngx/fw.op.fo.conf | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cfg/ngx/fw.op.fo.conf diff --git a/cfg/ngx/fw.op.fo.conf b/cfg/ngx/fw.op.fo.conf new file mode 100644 index 0000000..234e132 --- /dev/null +++ b/cfg/ngx/fw.op.fo.conf @@ -0,0 +1,48 @@ +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# configuration of fw.op.fo / frode klevstul / oct 2025 +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# http to https +server { + listen 80; + server_name fw.op.fo; + return 301 https://$host$request_uri; +} + +# hw to bare domain for https requests +#server { +# listen 443 ssl http2; +# listen [::]:443 ssl http2; +# +# ssl_certificate /etc/nginx/acme.sh/op.fo/fullchain.pem; +# ssl_certificate_key /etc/nginx/acme.sh/op.fo/key.pem; +# ssl_trusted_certificate /etc/nginx/acme.sh/op.fo/cert.pem; +# +# server_name hw.op.fo; +# return 301 $scheme://op.fo$request_uri; +#} + +server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + + ssl_certificate /etc/nginx/acme.sh/op.fo/fullchain.pem; + ssl_certificate_key /etc/nginx/acme.sh/op.fo/key.pem; + ssl_trusted_certificate /etc/nginx/acme.sh/op.fo/cert.pem; + + add_header Strict-Transport-Security "max-age=63072000" always; + + root /var/www/fw.op.fo; + index index.html; + server_name fw.op.fo; + + # redirect 404 not found to the root + location / { + error_page 404 = @myownredirect; + } + + location @myownredirect { + return 302 /; + } +}