Function createSelfSignedHttpsNginxSite

  • Creates:

    • A self signed SSL certificate
    • A new Nginx website which uses that certificate

    Make sure to remember to restart nginx (sudo systemctl restart nginx) after adding a site.

    This will likely require sudo permissions if run with the default nginx dir (/etc/nginx/).

    Parameters

    • site: Readonly<Omit<NginxSite, "config">> & Readonly<
          {
              locations: readonly Readonly<
                  Omit<
                      Omit<
                          {
                              children: (
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                                  | (
                                      Omit<{ type: "location"; context: ["server", "location"]; matcher?: "=" | "~" | "~*" | "^~"; uri: string; children: (Omit<{ type: "auth_basic"; context: ["http", "server", "location", "limit_except"]; value: string; }, "context"> | ... 14 more ... | Omit<...>)[]; }, "context">
                                  )
                                  | Omit<(...), (...)>
                                  | Omit<(...), (...)>
                              )[];
                              context: ["server", "location"];
                              matcher?: "=" | "~" | "~*" | "^~";
                              type: "location";
                              uri: string;
                          },
                          "context",
                      >,
                      "context",
                  >,
              >[];
          },
      >
    • sslParams: Readonly<
          PartialWithUndefined<
              {
                  cityName: string;
                  countryCode: string;
                  days: number;
                  organizationalUnitName: string;
                  organizationName: string;
                  outputPaths: PartialWithUndefined<
                      { certificate: string; dhParam: string; key: string },
                  >;
                  stateName: string;
                  websiteHostname: string;
              },
          >,
      > = {}
    • __namedParameters: Partial<{ log: Logger; nginxDirPath: string }> = {}

    Returns Promise<void>