![nginx: [emerg] 여기서는 'server' 지시어가 허용되지 않습니다.](https://linux55.com/image/5183/nginx%3A%20%5Bemerg%5D%20%EC%97%AC%EA%B8%B0%EC%84%9C%EB%8A%94%20'server'%20%EC%A7%80%EC%8B%9C%EC%96%B4%EA%B0%80%20%ED%97%88%EC%9A%A9%EB%90%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
서버를 구성하려고 할 때 다음 오류 메시지가 나타납니다.
[]# nginx -s reload
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/conf.d/hello-world.conf:1
구성은 다음과 같습니다.
/etc/nginx/nginx.conf:
...
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
...
index index.html index.htm;
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
server_name localhost;
root /usr/share/nginx/html;
location / {
}
}
}
/etc/nginx/conf.d/hello-world.conf:
server {
listen 80;
server_name my.server;
root i/var/www/hello-world;
index index.html;
location / {
}
}
nginx 버전: nginx/1.6.2 운영 체제: CentOS-70-64-minimal
나는 hello-world.conf의 내용을 nginx.conf에 복사했을 때 작동했기 때문에 server
내부 지침을 선택하지 않은 것 같습니다 .http
include
누구든지 나를 도와줄 수 있나요?