Cant restart Nginx!

Hi, I am setting up nginx on my Linode, when I try to restart nginx its returning "nginx: [emerg] unexpected end of file, expecting "}" in etc/nginx/conf.d/default.conf:57"

I have installed dos2unix to convert the file and fix the issue but dos2unix failed to convert the file. Its showing another error "dos2unix: problems converting file default.conf"

Have tried finding the exact issue with "nginx -t -c /etc/nginx/nginx.conf" and removed the two extra spaces after line #54, still not working!

Some input would be great for me.

Here is my default.conf file;

#

The default server

#

server {

listen 80 default_server;

server_name 103.3.63.200;

charset koi8-r;

access_log logs/host.access.log main;

Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;

location / {

root /usr/share/nginx/html;

index index.php index.html index.htm;

}

error_page 404 /404.html;

location = /404.html {

root /usr/share/nginx/html;

}

proxy the PHP scripts to Apache listening on 127.0.0.1:80

#

location ~ .php$ {

proxy_pass http://127.0.0.1;

}

pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ .php$ {

root /usr/share/nginx/html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgiparam SCRIPTFILENAME $documentroot$fastcgiscript_name;

include fastcgi_params;

}

deny access to .htaccess files, if Apache's document root

concurs with nginx's one

#

location ~ /.ht {

deny all;

}

}

Any help will be appreciated. Thanks in advance.

1 Reply

@zaqir:

location ~ .php$ {

root /usr/share/nginx/html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgiparam SCRIPTFILENAME $documentroot$fastcgiscript_name;

include fastcgi_params;

}

You commented the closing brace for the last PHP section.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct