plinth-infra/ngx/cocoon.ts
2025-05-02 15:06:00 +00:00

27 lines
680 B
TypeScript

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());