Type Alias RawNginxBlock

RawNginxBlock:
    | {
        children: NginxBlockTypesWithContext<"main">[];
        context: [];
        type: "main";
    }
    | { context: ["server"]; type: "listen"; values: string[] }
    | {
        children: NginxBlockTypesWithContext<"server">[];
        context: ["http"];
        type: "server";
    }
    | {
        context: ["http", "server", "location", "limit_except"];
        type: "auth_basic";
        value: string;
    }
    | {
        context: ["http", "server", "location", "limit_except"];
        file: string;
        type: "auth_basic_user_file";
    }
    | { file: string; type: "include" }
    | { context: ["main"]; file: string; type: "load_module" }
    | {
        context: ["http", "server"];
        protocols: (
            "SSLv2"
            | "SSLv3"
            | "TLSv1"
            | "TLSv1.1"
            | "TLSv1.2"
            | "TLSv1.3"
        )[];
        type: "ssl_protocols";
    }
    | {
        context: ["http", "server"];
        enabled: boolean;
        type: "ssl_prefer_server_ciphers";
    }
    | {
        context: ["http", "server", "location", "location.if"];
        enabled: boolean;
        type: "gzip";
    }
    | {
        context: ["http", "server", "location", "location.if", "limit_except"];
        type: "access_log";
        values: string[];
    }
    | {
        context: ["main", "http", "mail", "stream", "server", "location"];
        file: string;
        level?:
            | "debug"
            | "info"
            | "notice"
            | "warn"
            | "error"
            | "crit"
            | "alert"
            | "emerg";
        type: "error_log";
    }
    | {
        context: ["http", "server"];
        time: string;
        type: "ssl_session_timeout";
    }
    | {
        context: ["http", "server"];
        type: "ssl_session_cache";
        values: string[];
    }
    | {
        context: ["http", "server"];
        enabled: boolean;
        type: "ssl_session_tickets";
    }
    | { context: ["http", "server"]; enabled: boolean; type: "ssl_stapling" }
    | {
        context: ["http", "server"];
        enabled: boolean;
        type: "ssl_stapling_verify";
    }
    | { ciphers: string[]; context: ["http", "server"]; type: "ssl_ciphers" }
    | { context: ["http", "server"]; curves: string[]; type: "ssl_ecdh_curve" }
    | { context: ["http", "server"]; file: string; type: "ssl_dhparam" }
    | {
        always?: boolean;
        context: ["http", "server", "location", "location.if"];
        name: string;
        type: "add_header";
        value: string;
    }
    | {
        children: NginxBlockTypesWithContext<"http">[];
        context: ["main"];
        type: "http";
    }
    | {
        context: ["http", "server", "location", "location.if"];
        enabled: boolean;
        type: "sendfile";
    }
    | {
        context: ["http", "server", "location"];
        enabled: boolean;
        type: "tcp_nopush";
    }
    | {
        context: ["http", "server", "location"];
        mimeType: string;
        type: "default_type";
    }
    | {
        context: ["http", "server", "location"];
        size: number;
        type: "types_hash_max_size";
    }
    | { context: ["main"]; count: number | "auto"; type: "worker_processes" }
    | { context: ["main"]; group?: string; type: "user"; user: string }
    | { context: ["main"]; file: string; type: "pid" }
    | { context: ["events"]; count: number; type: "worker_connections" }
    | {
        children: NginxBlockTypesWithContext<"events">[];
        context: ["main"];
        type: "events";
    }
    | {
        code?: HttpStatus;
        context: ["server", "location", "if"];
        type: "return";
        url: string;
    }
    | {
        code: HttpStatus;
        context: ["server", "location", "if"];
        text: string;
        type: "return";
    }
    | {
        children: NginxBlockTypesWithContext<"location">[];
        context: ["server", "location"];
        matcher?: "=" | "~" | "~*" | "^~";
        type: "location";
        uri: string;
    }
    | { context: ["http", "server"]; file: string; type: "ssl_certificate" }
    | {
        context: ["http", "server"];
        file: string;
        type: "ssl_certificate_key";
    }
    | {
        context: ["http", "server", "location"];
        name: string;
        type: "proxy_set_header";
        value: string;
    }
    | {
        context: ["location", "location.if", "limit_except"];
        type: "proxy_pass";
        url: string;
    }

All raw Nginx block types. This includes a context property, which isn't used in block definitions but is used in types here to determine which children each block can have.

Type declaration