nginx unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/default:20 over Raspbian

azure storage emulator nginx: [emerg] unexpected end of parameter, expecting ";" in command line
nginx configuration file
nginx windows configuration file
nginx include config
nginx file server
nginx: (emerg invalid parameter access_log in /etc/nginx/sites-enabled reverse proxy conf 5)
log_format nginx examples
setup nginx

I'm new at nginx and Raspberry.

I installed nginx using

sudo apt-get install

And everything was fine at that point. The problem came when I tried to restart nginx, It threw this error

Job for nginx.service failed. See 'systemctl status ngins.service' and 'journaldtl -xn' for details

After an investigation I found that the problem is the next error:

unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/default:20

My default file is:

# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
## 

server {
    #listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default_server ipv6only=on; ## listen for ipv6
    listen 80;
    server_name $domain_name;
    root /var/www;
    index index.html index.htm;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;



    # Make site accessible from http://localhost/
    server_name localhost;

    location /

I hope you can help me :)

as @Thanh Nguyen Van has answered already. the location has to be opened and closed in curly braces and then another curly brace for your server's end

server {
    #listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default_server ipv6only=on; ## listen for ipv6

    listen 80;
    server_name $domain_name;
    root /var/www;
    index index.html index.htm;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    # Make site accessible from http://localhost/
    server_name localhost;

    location / {

    }
}

Nginx unexpected end of file, Using the nginx config checker ( nginx -t ) it tells me that theres an error on line 74: [emerg] unexpected end of file, expecting ";" or "}" in  Nginx only -- unexpected end of file, expecting ";" or "}" in /etc/nginx/conf.d/vesta.conf:4 nginx: #21

I had the same issue. Confirmed there was a missing ; at the end of a new added line inside the server block '{...}`.

Ensure the curly braces and ; are all in place.

nginx: [emerg] unexpected end of file, expecting, nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-​enabled/jupyter.example.com:59. [SOLVED]. After executing nginx -s reload to load  nginx unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/default:20 over Raspbian - Stack Overflow I'm new at nginx and Raspberry. I installed nginx using sudo apt-get install And everything was fine at that point. The problem came when I tried to restart nginx, It threw this error Job

Correct your nginx file as below :

For example:

http {


       upstream api-app {
        .....................;   

        }
        ........................; 
        server {

              location / {
               ...................;
               proxy_set_header Host $host;
               proxy_cache_bypass $http_upgrade;

              }
        }

}

Make sure ; at the end of line, and { ..} correctly.

Error, Get the following errors message: nginx: [emerg] unexpected end of file, expecting "}" in /opt/bitnami/nginx/conf/nginx.conf:68. Thank you in  > nginx: [emerg] unexpected end of parameter, expecting ";" in command line > nginx: configuration file ./conf/nginx.conf test failed I'm not sure where did you come up with that syntax, but it's wrong.

Also make sure you have no unexpected quotes (single nor double). It took me a while to figure out one time when I was using Docker and passing the value as an env var, so it was mistakenly quoted.

So, this will be an incorrect bit:

upstream backend {
    "server localhost:9000;"
}

This is a correct one:

upstream backend {
    server localhost:9000;
}

Error Setting up Server Blocks on Nginx, nginx -t -c /etc/nginx/nginx.conf nginx: [emerg] unexpected end of file, expecting "}​" in /etc/nginx/sites-enabled/default:113 nginx: configuration  Parse error: syntax error, unexpected end of file in C:\wamp\www\project-Feedback form\project docs\login.php on line 80 I have attached the entire snippet of code:

nginx: [emerg] unexpected end of file, expecting, However, when I checked the configuration with `nginx -t`, it threw the following error… nginx: [emerg] unexpected end of file, expecting ";" or  It sounds like you have a missing '}', ';' or bracket but it would help if you posted you whole php code – ryanc1256 Jul 14 '12 at 9:23. A year and a half hence, it is funny that this question was closed because it is too localized but it has got almost 50k views.

Nginx & letsencrypt - end of file, expecting, [emerg] 1#1: unexpected end of file, expecting “;” or “}” in /etc/letsencrypt/options-​ssl-nginx.conf:2. Try showing the complete nginx config  nginx: [emerg] unexpected end of file, expecting “;” or “}” in /etc/nginx/sites-enabled/1:9 nginx: configuration file /etc/nginx/nginx.conf test failed This 1:9 is for the file generated by EasyEngine , just below follows the same content:

Restarting nginx: nginx: [emerg] unexpected end of file, expecting , firstuser@zulu1449:~$ sudo service nginx restart. Restarting nginx: nginx: [emerg​] unexpected end of file, expecting ";" or "}" in  I want to setup nginx with my docker-compose on my domain name vip-75.com but I keep having this issue and I don't see where my nginx.conf file is incorrect: [emerg] 1#1: unexpected end of file,

Comments
  • can you show the 20th line in default file ?
  • Is exactly the line below :location / I tried writing ´}´ but it doesn't work. In fact I didn't modify that file :/
  • Thanks.I just missed a ";" at the end of a new added line inside the location block {}.