nginx: directive is not terminated by ";" Nginx / Apache Origin: Edge & web server OSI layer 7 · Application Last updated 5 Nov 2026

Nginx: nginx: [emerg] directive "proxy_pass" is not terminated by ";" in /etc/nginx/sites-enabled/app:15

A directive's arguments run into the next line because the ; is missing (or a quote is unbalanced).

Exact message you may see nginx: [emerg] directive "proxy_pass" is not terminated by ";"[emerg] directive is not terminated by ";" in /etc/nginx[emerg] invalid number of arguments in "server_name" directive[emerg] unknown directive in /etc/nginx[emerg] invalid parameter "x" in /etc/nginx
Seen on: Nginx Linux

Meaning

The error names the directive and line. Check for the missing semicolon at the end of that directive, an unclosed quote inside the value, or a stray {/}. Also "invalid number of arguments in X directive" means wrong argument count.

Common causes

  • Missing ; at the end of the line
  • Unclosed quote in a value
  • Special characters not quoted ($, ;)
  • Wrong number of arguments
  • Line break inside a value

⚡ Quick fix

  1. Add ; to the named directive
  2. Quote values with spaces/special characters
  3. Run nginx -t after each change

Detailed fix by platform

Linux

  1. sudo nginx -t prints the exact line

How to diagnose

  1. Directive — Named in message?
  2. Quote — Balanced?
  3. Args — Right count?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

AH00526: Syntax error on line of apache config — Apache: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/site.conf: Invalid command 'Foo', perhaps misspelled or defined by a module not included in the server configuration (Nginx / Apache)AH00526: Syntax error…could not build the server_names_hash, you should increase server_names_hash_bucket_size — Nginx: nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 64 (Nginx / Apache)could not build the s…nginx: [emerg] open() failed (2: No such file or directory) — Nginx: nginx: [emerg] open() "/etc/nginx/snippets/fastcgi-php.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/app:20 (Nginx / Apache)nginx: [emerg] open()…nginx: [emerg] unexpected end of file, expecting ";" or "}" — Nginx: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/conf.d/site.conf:42 (Nginx / Apache)nginx: [emerg] unexpe…nginx: [emerg] unknown directive — Nginx: nginx: [emerg] unknown directive "x" in /etc/nginx/sites-enabled/x:12 — configuration file test failed (Nginx / Apache)nginx: [emerg] unknow…nginx: conflicting server name ignored — Nginx: nginx: [warn] conflicting server name "example.com" on 0.0.0.0:80, ignored (Nginx / Apache)nginx: conflicting se…nginx: duplicate location — Nginx: nginx: [emerg] duplicate location "/" in /etc/nginx/sites-enabled/default:52 (Nginx / Apache)nginx: duplicate loca…no "ssl_certificate" is defined for the "listen ... ssl" directive — Nginx: [emerg] no "ssl_certificate" is defined for the "listen ... ssl" directive in /etc/nginx/sites-enabled/default:3 (SSL / TLS)no "ssl_certificate" …nginx: di…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.