Answer the question
In order to leave comments, you need to log in
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
" 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;
}
Answer the question
In order to leave comments, you need to log in
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question