add default server ngx config

This commit is contained in:
Charlotte Som 2024-11-27 03:48:23 +00:00
parent 5a3563de77
commit 2425b4ea14
4 changed files with 19 additions and 0 deletions

1
ngx/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/out

4
ngx/build.sh Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
mkdir out 2>/dev/null || true
deno run ./default.ts > out/default.conf

12
ngx/default.ts Normal file
View file

@ -0,0 +1,12 @@
import ngx from "jsr:@char/ngx@0.2";
export const config = ngx("server", [
[
"listen 80 default_server",
"listen [::]:80 default_server"
],
ngx("location '/.well-known/acme-challenge'", ["root /srv/www/acme"]),
ngx("location /", ["return 302 https://$host$request_uri"]),
]);
if (import.meta.main) console.log(config.build());

2
www/acme/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!/.gitignore