Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>NGINX ConfigNew to Visual Studio Code? Get it now.
NGINX Config

NGINX Config

gmm

|
1 install
| (0) | Free
| Sponsor
nginx configuration support with real linting: directives checked by context and argument count, hover docs from nginx.org, context-aware completion, include and upstream navigation, a formatter that never drops lines, and CertView integration.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

NGINX Config — VS Code Extension

VS Code Marketplace CI License: MIT

nginx configuration support that actually lints. Catch the mistakes nginx -t would refuse — a directive in the wrong block, the wrong number of arguments, proxy_pass without a scheme, an unclosed { — while you type, with the official nginx.org documentation one hover away.

Works in VS Code and every Open VSX editor (VSCodium, Cursor, Windsurf, Gitpod, Eclipse Theia).

Built and maintained by Juan Torchia as part of GMM Software Solutions.

Tour: diagnostics, hover docs, completion, formatting, go to upstream and CertView


Why another nginx extension

The popular nginx extensions highlight syntax and stop there; most have not been updated in years and none checks directives against the documentation. This one ships a language server with a catalog of all 841 directives of nginx and its official modules (generated from nginx.org: syntax, default, context, module), and uses it to validate, complete and document your config.

It was tuned against more than 450 real-world configs (Debian/Ubuntu defaults, the official Docker image, Certbot, h5bp, Mastodon, Discourse, Nextcloud, linuxserver's 400+ reverse-proxy confs, OpenResty) so that valid configs produce zero diagnostics.

Features

Validation that mirrors nginx -t

Diagnostics

Check Severity Example
Unknown directive Warning proxy_read_timout 60s;
Directive not allowed in this block Error worker_processes inside server
Invalid number of arguments Error root /srv/a /srv/b;, or a missing ; that merges two lines
Block directive without { }, or { } on a simple directive Error server;
proxy_pass without http:// / https:// Error proxy_pass backend:8080; (stream proxy_pass is left alone)
Unclosed blocks, stray }, missing ;, unterminated quotes Error
Certificate or key file not found Information ssl_certificate /etc/nginx/ssl/site.pem; — switch off with nginx.validate.missingCertificates

Contexts follow the docs exactly, including http vs stream vs mail (server, listen and proxy_pass mean different things in each), if in location, limit_except and upstream. Files meant to be included (sites-available/*, conf.d/*.conf, snippets) are recognised as fragments: their top level is not checked against the main context, and stream fragments are detected automatically.

Directives of common third-party modules (Lua/OpenResty, headers-more, Brotli, Passenger, ModSecurity, GeoIP2, VTS, set-misc, …) are never reported, Lua blocks are skipped verbatim, and you can add your own module's directives to nginx.validate.ignoredDirectives.

Hover docs from nginx.org

Hover documentation

Syntax, default, allowed contexts, module, the version it appeared in, an NGINX Plus only badge where it applies, and the start of the official description with a link to the full page. Ambiguous names (server, listen, proxy_pass) show the variant for the block you are in.

Context-aware completion

Completion

Only the directives valid in the current block (http, server, location, upstream, events, stream, mail, if, limit_except), with snippets for blocks and on | off choices. After proxy_pass, fastcgi_pass, grpc_pass, … it offers the upstreams defined in the file.

Navigation

Go to upstream

  • Go to definition on proxy_pass http://backend (and the other *_pass directives) jumps to upstream backend { }, in the same file or anywhere in the workspace.
  • Follow include: Ctrl/Cmd+click opens the file; go to definition on a glob (include conf.d/*.conf;) lists every match. Relative paths resolve against the nginx prefix (the folder holding nginx.conf), and absolute production paths such as /etc/nginx/sites-enabled/* are also looked up inside your workspace.
  • error_page … @fallback and try_files … @app jump to the named location.
  • Outline and breadcrumbs for every block, with server_name and listen shown next to each server.
  • Folding for blocks and comment runs.

A formatter that never deletes lines

Formatting

Format Document only re-indents by block depth and trims trailing whitespace. It never joins, splits, adds or removes lines, never touches the text of comments, multi-line strings or Lua code, and running it twice changes nothing. It is tested for exactly that on every fixture and on 560+ real configs.

Open certificates in CertView

Open in CertView

With the free CertView extension installed, an Open in CertView CodeLens appears above ssl_certificate, ssl_trusted_certificate, ssl_client_certificate and their proxy_/grpc_/uwsgi_ variants. One click shows the subject, SANs, validity, chain and lint findings of the certificate nginx will serve.

CertView

Certificate and include paths are also clickable links.

Syntax highlighting and snippets

Syntax highlighting

TextMate grammar for directives, blocks, location modifiers and patterns, variables ($host, ${var}), strings, key=value parameters, numbers with units, comments and embedded Lua. Snippets: server-proxy, server-static, location-php, upstream, map-websocket.

File detection

The nginx language is used for nginx.conf, nginx*.conf, *.nginx, *.nginxconf, fastcgi_params, fastcgi.conf, scgi_params, uwsgi_params, proxy_params, and any file under sites-available/, sites-enabled/, conf.d/*.conf or an nginx/ folder. For other names, pick NGINX in the language picker or add a files.associations entry:

"files.associations": { "*.conf.template": "nginx" }

Files that match a pattern but are clearly not nginx (Apache, Dovecot, rspamd, syslog-ng under conf.d/) get no diagnostics.

Settings

Setting Default Description
nginx.validate.enable true Live diagnostics.
nginx.validate.unknownDirectives true Warn about directives outside nginx and its official modules.
nginx.validate.ignoredDirectives [] Directive names never reported as unknown (third-party modules).
nginx.validate.missingCertificates true Report certificate/key files that cannot be found locally (information).
nginx.completion.enable true Context-aware completion.
nginx.certView.codeLens true Show Open in CertView when CertView is installed.
nginx.trace.server off Language server protocol tracing.

Privacy

No telemetry, no network access. The extension reads the nginx files you open, other nginx files in your workspace (to find upstream blocks) and checks whether referenced certificate files exist — it never reads their contents.

Development

npm ci && npm ci --prefix client && npm ci --prefix server
npm run build
npm test                  # unit + integration (integration needs a display, e.g. xvfb-run)
npm run catalog:generate  # refresh the directive catalog from nginx.org

See docs/development.md and docs/architecture.md.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft