Files
srv-pub/cfg/ngx/default.conf
2025-10-28 17:02:23 -05:00

32 lines
920 B
Plaintext

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# configuration for default server. / frode klevstul / oct 2025
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# all domains pointed to this server will be handled by this config, unless otherwise specified.
server {
listen 80 default_server;
root /var/www/default;
index index.html;
server_name ~^(.+)$;
# https://stackoverflow.com/questions/14937879/how-to-tell-nginx-to-redirect-all-pages-of-the-website-to-root
location = / {
try_files /index.html = 404;
}
location / {
rewrite ^ / permanent;
}
}
server {
listen 443 ssl;
server_name ~^(.+)$;
ssl_certificate /etc/nginx/acme.sh/op.fo/fullchain.pem;
ssl_certificate_key /etc/nginx/acme.sh/op.fo/key.pem;
#return 301 http://$server_name;
return 301 http://$host$request_uri;
}