Join the community today
Become a Member

Unknown directive on include in nginx.conf

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Mrbo, Feb 26, 2019.

  1. Mrbo

    Mrbo Member

    113
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    9:58 PM
    I get an error on every include command in nginx.conf. I tried to comment the error line but then it just gives me an error for the next include line, but the files it tries to include are there.

    • VPS: Vultr $20 plan, 2 CPU
    • CentOS Version: CentOS 7.6.1810 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.15.8
    • PHP Version Installed: 7.3.2
    • MariaDB MySQL Version Installed: 10.3.13
    • When was last time updated Centmin Mod code base ? : Today
    • Persistent Config:


      Code:
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      NGINX_ZERODT='y'
      NGINX_LIBBROTLI='n'
      NGXDYNAMIC_BROTLI='n'
      PHP_PGO='y'
      MARIADB_INSTALLTENTHREE='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      MARCH_TARGETNATIVE='n'
      LETSENCRYPT_DETECT='y'
      DUALCERTS='y'
      VHOSTCTRL_CLOUDFLAREINC='y'
      
    Error

    Code:
    systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
    nginx[17659]: Starting nginx: nginx: [emerg] unknown directive "/usr/local/src/centminmod/tools/csfcf.sh" in /usr/local/nginx/conf/nginx.conf:53
    nginx[17659]: [FAILED]
    systemd[1]: nginx.service: control process exited, code=exited status=1
    systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.
    systemd[1]: Unit nginx.service entered failed state.
    systemd[1]: nginx.service failed.
    
    Code:
    [09:35][root@contribution]# nginx -t
    nginx: [emerg] unknown directive "/usr/local/src/centminmod/tools/csfcf.sh" in /usr/local/nginx/conf/nginx.conf:53
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    [09:36][root@contribution]# nginx -t
    nginx: [emerg] unknown directive "/usr/local/src/centminmod/tools/csfcf.sh" in /usr/local/nginx/conf/nginx.conf:59
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    [09:41][root@contribution]# nginx -t
    nginx: [emerg] unknown directive "/usr/local/src/centminmod/tools/csfcf.sh" in /usr/local/nginx/conf/nginx.conf:61
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
     
    Last edited: Feb 26, 2019
  2. eva2000

    eva2000 Administrator Staff Member

    50,923
    11,806
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,264
    Local Time:
    12:58 AM
    Nginx 1.25.x
    MariaDB 10.x
  3. Mrbo

    Mrbo Member

    113
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    9:58 PM
    The line was there from the beginning and I just removed the comment since im using cloudflare.

    Shouldn't it be like this?
    Code:
    # uncomment cloudflare.conf include if using cloudflare for
    # server and/or vhost site + setup cron job for command
     /usr/local/src/centminmod/tools/csfcf.sh auto
    # run the auto command once to populate cloudflare ips
    include /usr/local/nginx/conf/cloudflare.conf;
    # uncomment incapsula.conf include if using incapsula for
    # server and/or vhost site + setup cron job for command
    # /usr/local/src/centminmod/tools/csfincapsula.sh auto
    # run the auto command once to popular incapsula ips
    #include /usr/local/nginx/conf/incapsula.conf;
    I also tried to comment it but i still get the error.
    More error info:

    Code:
    [13:22][root@contribution ~]# systemctl status nginx.service
    ● nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
       Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled)
       Active: failed (Result: exit-code) since Tue 2019-02-26 13:22:40 UTC; 11s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 5948 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)
     Main PID: 7469 (code=exited, status=0/SUCCESS)
    
    Feb 26 13:22:40 contribution systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
    Feb 26 13:22:40 contribution nginx[5948]: Starting nginx: nginx: [emerg] unknown directive "/usr/local/src/centminmod/tools/csfcf.sh" in /usr/local/nginx/conf/nginx.conf:53
    Feb 26 13:22:40 contribution nginx[5948]: [FAILED]
    Feb 26 13:22:40 contribution systemd[1]: nginx.service: control process exited, code=exited status=1
    Feb 26 13:22:40 contribution systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.
    Feb 26 13:22:40 contribution systemd[1]: Unit nginx.service entered failed state.
    Feb 26 13:22:40 contribution systemd[1]: nginx.service failed.
    [13:22][root@contribution ~]#
    
     
    Last edited: Feb 26, 2019
  4. eva2000

    eva2000 Administrator Staff Member

    50,923
    11,806
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,264
    Local Time:
    12:58 AM
    Nginx 1.25.x
    MariaDB 10.x
    remove the line /usr/local/src/centminmod/tools/csfcf.sh auto it's not meant to be in nginx.conf
     
  5. Mrbo

    Mrbo Member

    113
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    9:58 PM
    Amazing, thank you so much!