Make ngx script only write the config if run directly
This commit is contained in:
parent
316d7b52d8
commit
67c65c4f1b
1 changed files with 6 additions and 2 deletions
|
@ -2,11 +2,15 @@
|
|||
|
||||
import ngx from "https://char.lt/ngx/ngx.ts?v=1";
|
||||
|
||||
ngx("server", [
|
||||
export const site = ngx("server", [
|
||||
[
|
||||
"server_name bio.char.lt",
|
||||
...ngx.listen(),
|
||||
...ngx.letsEncrypt("bio.char.lt"),
|
||||
],
|
||||
ngx("location /", ["root /srv/http/bio.char.lt/public"]),
|
||||
]).write("/etc/nginx/http.d/bio-char-lt.conf");
|
||||
]);
|
||||
|
||||
if (import.meta.main) {
|
||||
site.write("/etc/nginx/http.d/bio-char-lt.conf");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue