nginx: [emerg] 여기서는 'server' 지시어가 허용되지 않습니다.

nginx: [emerg] 여기서는 'server' 지시어가 허용되지 않습니다.

서버를 구성하려고 할 때 다음 오류 메시지가 나타납니다.

[]# 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내부 지침을 선택하지 않은 것 같습니다 .httpinclude

누구든지 나를 도와줄 수 있나요?

관련 정보