A
A
Andrew2015-04-30 21:30:28
Nginx
Andrew, 2015-04-30 21:30:28

I messed up the default nginx.conf with training. How to fix the error?

People already understood that at first it was necessary to back up the default settings, but only now it has come to pass.
So, after various trainings with Nginx settings and trying to do service nginx restart, an error occurs: "

nginx: [emerg] invalid variable name in /etc/nginx/nginx.conf:25
nginx: configuration file /etc/nginx/nginx.conf test failed
"
I tried to bring it from memory to the default view (after installation) by deleting the parameters and led to this view:
user  nginx;
worker_processes  2;

error_log   /var/log/nginx/error.log;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    use epoll;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    include /etc/nginx/conf.d/*.conf;
}

One fig, when restarting the service, an error occurred. What is there to complain about? In which variable (variable name) did I make a mistake?
Thank you for your help.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2015-05-01
@actinogr

See what is in include /etc/nginx/conf.d/*.conf;

3
3vi1_0n3, 2015-04-30
@3vi1_0n3

Remove the package and reinstall. Or take the default config from the package.
The config is in the package, the package is in the cache, the cache for ubunta and debian, for example, in /var/cache/apt.

R
Rikcon, 2015-04-30
@Rikcon

wiki.nginx.org/FullExample

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question