# nginx/config-test

> Runs `nginx -t` on each main file inside the image, with a throwaway certificate and resolved upstream names. Records every file that nginx parsed.

Runs `nginx -t` on each main file inside the image, with a throwaway certificate and resolved upstream names. Records every file that nginx parsed.

Part of the [`nginx`](/reference/configurations/nginx/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `push` [stage](/start/concepts/#stage), once per scope. It runs docker. It needs Docker, running.

## Why

Only nginx itself can confirm that a file parses; otherwise the first test comes at the restart in production.

## What to do

Fix the line nginx names. Set `tools.nginx.image` to the one your deployment runs.

## Example

The line `invalid_directive on;` fails `nginx -t`. Remove it, or replace it with a known directive such as `listen 443 ssl;`.

## Turn it off

Turn it off for some files, with a reason:

```shell
gspot ignore nginx/config-test --paths "<glob>" --reason "<why>"
```
