+ default.conf

This commit is contained in:
fro
2025-10-28 16:55:08 -05:00
parent c4799746a5
commit 98bc6522cf

26
cfg/ngx/default.conf Normal file
View File

@@ -0,0 +1,26 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 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 default_server;
server_name ~^(.+)$;
return 301 http://$server_name;
}