Extra Form
PHP PHP 7.1
CMS Rhymix

갑자기 504 gateout 오류가 나와서 nginx 설정을 고친 후 재시작을 했는데 제대로 되지 않은 것 같아 원래 설정으로 복구 후 다시 재시작을 눌렸더니

 

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-09-12 14:40:28 KST; 8s ago
  Process: 2026 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Sep 12 14:40:28 fcseoulite systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 12 14:40:28 fcseoulite nginx[2026]: nginx: [emerg] duplicate location "/" in /etc/nginx/conf.d/default.conf:17
Sep 12 14:40:28 fcseoulite nginx[2026]: nginx: configuration file /etc/nginx/nginx.conf test failed
Sep 12 14:40:28 fcseoulite systemd[1]: nginx.service: Control process exited, code=exited status=1
Sep 12 14:40:28 fcseoulite systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Sep 12 14:40:28 fcseoulite systemd[1]: nginx.service: Unit entered failed state.
Sep 12 14:40:28 fcseoulite systemd[1]: nginx.service: Failed with result 'exit-code'.
 

 

와 같은 오류가 나옵니다.

 

nginx 설정은

server {

    server_name fcseoulite.me; 

    root /usr/share/nginx/html; 

    index index.html index.php;
    
    client_max_body_size 32m;

    location / { 
        index index.php index.html;
    }

    include snippets/rhymix.conf;

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) { 
            return 404;
        }
        
        fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param HTTPS on;
        include fastcgi_params;    
    }

 

로 되어있습니다.

  • profile

    [emerg] duplicate location "/" in /etc/nginx/conf.d/default.conf:17

    이게 핵심인 것 같네요. 본문에 붙이신 내용은 17줄에 location이 없으니, 문제가 있는 파일이 아닌 듯 합니다.

  • profile profile
    뭐가 문제인지 잘 모르겠네요..
  • profile profile
    아 고쳤습니다;;; 제가 conf.d 디렉터리의 default.conf를 수정하고 있다고 생각했는데 보니깐 그냥 nginx 디렉터리의 default를 수정하고 있었네요;;...
    기존에 있던 nginx 디렉터리의 default.conf는 사라졌는데 어떡해야 할지..ㅠㅠ
  • profile profile
    /etc/nginx 폴더에는 원래 default.conf가 없습니다.
  • profile profile
    앗..🤭