diff --git a/ngx/build.sh b/ngx/build.sh index 157c0c5..8926198 100755 --- a/ngx/build.sh +++ b/ngx/build.sh @@ -9,3 +9,4 @@ deno run ./charlotte-partners.ts > out/charlotte-partners.conf deno run ./charlotte-partners-labeler.ts > out/charlotte-partners-labeler.conf deno run ./bfuse-filter-umm-gay.ts > out/bfuse-filter-umm-gay.conf deno run ./hang-out-while-she-watches.ts > out/hang-out-while-she-watches.conf +deno run ./cocoon.ts > out/cocoon.conf diff --git a/ngx/cocoon.ts b/ngx/cocoon.ts new file mode 100644 index 0000000..d1c87d1 --- /dev/null +++ b/ngx/cocoon.ts @@ -0,0 +1,27 @@ +import ngx from "jsr:@char/ngx@0.1"; + +export const config = ngx("", [ + ngx("map $http_upgrade $connection_upgrade", [ + "default upgrade", + "'' close" + ]), + [], + ngx("server", [ + [ + "server_name cocoon.bun.how", + ...ngx.listen(), + ...ngx.letsEncrypt("cocoon.bun.how"), + ], + ngx("location /", [ + "client_max_body_size 1G", + "proxy_pass http://127.0.0.12:8080", + "proxy_http_version 1.1", + "proxy_set_header Upgrade $http_upgrade", + "proxy_set_header Connection $connection_upgrade", + "proxy_set_header Host $host", + "proxy_read_timeout 300s", + ]), + ]), +]); + +if (import.meta.main) console.log(config.build());