【Nginx】invalid number of arguments in "root"directive in/etc/nginx/conf.d/default.conf:의 대처법
                                            
                                                
                                                
                                                
                                                
                                                
                                                 2248 단어  문제해결docker-composenginx
                    

Nginx에 액세스할 수 없는 사안이 발생해, 로그를 쫓아 보면
docker-compose up 직후에 이하의 에러가 나오고 있는 것을 깨달았습니다.invalid number of arguments in "root" directive in /etc/nginx/conf.d/default.conf:8
default.conf의 8 행이 이상하다는 것은 문면에서 읽을 수 있습니다.
원인은 문법 오류
nginx.conf
server {
  listen 80;
  server_name localhost;
  root /var/www/html;
  index index.php index.html
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  location / {
    try_files $uri $uri/ /index.php$is_args$args;
  }
  location ~ \.php$ {
    fastcgi_pass php:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}
6행째의
index index.php index.html 말미의 세미콜론이 빠진 것이 원인이었습니다.
                Reference
이 문제에 관하여(【Nginx】invalid number of arguments in "root"directive in/etc/nginx/conf.d/default.conf:의 대처법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ohbashunsuke/items/13fcceccc2936f698e17텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)