+ klevstul.com.conf

This commit is contained in:
fro
2025-11-02 12:24:22 -05:00
parent 1dc80eedd3
commit de1c8e7c9e

49
cfg/ngx/klevstul.com.conf Normal file
View File

@@ -0,0 +1,49 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# configuration of klevstul.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 klevstul.com www.klevstul.com;
return 301 https://frode.klevstul.com;
}
# www to bare domain for https requests
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
ssl_certificate /etc/nginx/acme.sh/klevstul.com/fullchain.pem;
ssl_certificate_key /etc/nginx/acme.sh/klevstul.com/key.pem;
ssl_trusted_certificate /etc/nginx/acme.sh/klevstul.com/cert.pem;
server_name klevstul.com www.klevstul.com;
return 301 https://frode.klevstul.com;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
ssl_certificate /etc/nginx/acme.sh/klevstul.com/fullchain.pem;
ssl_certificate_key /etc/nginx/acme.sh/klevstul.com/key.pem;
ssl_trusted_certificate /etc/nginx/acme.sh/klevstul.com/cert.pem;
root /var/www/klevstul.com/jongleur;
index index.html;
server_name frode.klevstul.com;
# redirect 404 not found to the root
location / {
error_page 404 = @myownredirect;
}
location @myownredirect {
return 302 /;
}
}