# configuration/strings/nginx.strings.ts

> 41 lines of code and 13 definitions.

Tree: Project Scripts
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/scripts#file-scripts-configuration-strings-nginx-strings-ts
Source text: https://banes-lab.com/source/scripts/configuration/strings/nginx.strings.ts.txt

Listed in [configuration/strings](https://banes-lab.com/api/source/scripts/configuration/strings.md), after [configuration/strings/dependency.strings.ts](https://banes-lab.com/source/scripts/configuration/strings/dependency.strings.ts.md) and before [configuration/strings/rate.strings.ts](https://banes-lab.com/source/scripts/configuration/strings/rate.strings.ts.md).

## Definitions

- `commentsHeld` (lexical_declaration, line 11, exported)
- `commentsHeading` (lexical_declaration, line 15, exported)
- `engineHeld` (lexical_declaration, line 22, exported)
- `engineHeading` (lexical_declaration, line 26, exported)
- `otherEngine` (lexical_declaration, line 32, exported)
- `headersHeld` (lexical_declaration, line 36, exported)
- `headersHeading` (lexical_declaration, line 40, exported)
- `openReferrer` (lexical_declaration, line 48, exported)
- `COMMENT_REMEDY` (lexical_declaration, line 19, exported)
- `ENGINE_MISSING` (lexical_declaration, line 30, exported)
- `openSource` (lexical_declaration, line 44, exported)
- `HEADERS_REMEDY` (lexical_declaration, line 52, exported)
- `ENGINE_REMEDY` (lexical_declaration, line 54, exported)

## Contained in

- [configuration/strings](https://banes-lab.com/anatomy/scripts/folder-scripts-configuration-strings.md)

## Used by

- [core/validators/nginx.validator.ts](https://banes-lab.com/source/scripts/core/validators/nginx.validator.ts.md)

## Linked from

- [core/validators](https://banes-lab.com/anatomy/scripts/folder-scripts-core-validators.md)

## Source

```typescript
import {
    ENGINE_DIRECTIVE,
    IMPORT_DIRECTIVE,
    POLICY_HEADER,
    PRIVATE_REFERRERS,
    REFERRER_HEADER,
    REQUIRED_ENGINE,
    TERMINATOR,
} from "#configuration/constants/nginx.constants";

export const commentsHeld = function commentsHeld(count: number): string {
    return `[config-comments] ${String(count)} server configuration file(s) carry no comment\n`;
};

export const commentsHeading = function commentsHeading(count: number): string {
    return `[config-comments] ${String(count)} comment line(s) in the server configuration:`;
};

export const COMMENT_REMEDY =
    "  A configuration file states directives only. Delete the comment, and record a non-obvious reason in the server member's manifest.";

export const engineHeld = function engineHeld(count: number): string {
    return `[config-engine] ${String(count)} server configuration file(s) checked, and every one that imports an njs script selects ${REQUIRED_ENGINE}\n`;
};

export const engineHeading = function engineHeading(count: number): string {
    return `[config-engine] ${String(count)} server configuration file(s) do not select the script engine:`;
};

export const ENGINE_MISSING = `imports an njs script and declares no ${ENGINE_DIRECTIVE}`;

export const otherEngine = function otherEngine(engine: string): string {
    return `declares ${ENGINE_DIRECTIVE} ${engine}`;
};

export const headersHeld = function headersHeld(count: number): string {
    return `[config-headers] ${String(count)} server configuration file(s) checked, and every policy header names closed sources and a private referrer policy\n`;
};

export const headersHeading = function headersHeading(count: number): string {
    return `[config-headers] ${String(count)} policy header value(s) open the page to other origins:`;
};

export const openSource = function openSource(source: string): string {
    return `${POLICY_HEADER} allows the source ${source}`;
};

export const openReferrer = function openReferrer(value: string): string {
    return `${REFERRER_HEADER} is ${value}`;
};

export const HEADERS_REMEDY = `  Name each origin a ${POLICY_HEADER} directive loads from, with no scheme alone, wildcard or unsafe keyword, and set ${REFERRER_HEADER} to ${[...PRIVATE_REFERRERS].join(" or ")}.`;

export const ENGINE_REMEDY = `  The njs scripts are written and tested against a full ECMAScript engine, and the default njs engine lacks built-ins such as Map. Add the directive "${ENGINE_DIRECTIVE} ${REQUIRED_ENGINE}${TERMINATOR}" beside the ${IMPORT_DIRECTIVE}.`;
```
