Files
srv-pub/cfg/ngx/hw.op.fo.conf

50 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2025-10-28 16:54:59 -05:00
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# configuration of hw.op.fo / frode klevstul / oct 2025
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2025-10-28 15:24:41 -05:00
2025-10-28 15:43:28 -05:00
# http to https
2025-10-28 15:24:41 -05:00
server {
listen 80;
2025-10-28 15:33:30 -05:00
server_name hw.op.fo;
2025-10-28 15:43:28 -05:00
return 301 https://$host$request_uri;
2025-10-28 15:24:41 -05:00
}
2025-10-28 15:43:28 -05:00
# 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;
#}
2025-10-28 15:24:41 -05:00
# hw.op.fo
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
2025-10-28 15:24:41 -05:00
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;
2025-10-28 15:24:41 -05:00
root /var/www/hw.op.fo;
index index.html;
server_name hw.op.fo;
# redirect 404 not found to the root
location / {
error_page 404 = @myownredirect;
}
location @myownredirect {
return 302 /;
}
}