Learn about Centmin Mod LEMP Stack today
Become a Member

Expression Engine on NGinx?

Discussion in 'Blogs & CMS usage' started by fhuard, Aug 8, 2015.

Tags:
  1. fhuard

    fhuard New Member

    3
    1
    3
    Jul 30, 2015
    Ratings:
    +1
    Local Time:
    9:27 AM
    Hello,

    I'm having difficulties to setup a web site with the Expression Engine on Nginx. For unknown reasons, once every few minutes, the following error will appear on screen, on any page that I select to view:

    "Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php"

    Then, it comes back with no issues. On Apache, I don't have any .htaccess rules but it looks that I had to add rules for nginx so I did that:

    # prevent access to ./directories and files
    location / {
    index index.html index.htm index.php;
    # Removes index.php from URLs
    if (!-e $request_filename) {
    rewrite ^/(.*)$ /index.php/$1 last;
    }
    }

    # Standard pass for all PHP files
    location ~ \.php$ {
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME /vorticomm/wwwroot/bucc.ca/$fastcgi_script_name;
    }

    # This is where all the ExpressionEngine magic happens
    location ~ \.php($|/) {
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;

    set $script $uri;
    set $path_info "";

    if ($uri ~ "^(.+\.php)(/.+)") {
    set $script $1;
    set $path_info $2;
    }

    fastcgi_param SCRIPT_FILENAME /vorticomm/wwwroot/bucc.ca/$script;
    fastcgi_param SCRIPT_NAME $script;
    fastcgi_param PATH_INFO $path_info;
    }

    Does anyone had similar issue with that software? For now, I have to keep it on Apache and it sucks :-(

    Cheers,
    Franco
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:27 PM
    Nginx 1.13.x
    MariaDB 5.5
    never used Expression Engine so can't help you there. But Centmin Mod already has a php location setting in each nginx site domain vhost created - it's included as an include file at /usr/local/nginx/conf/php.conf see contents at centminmod/php.conf at 123.08stable · centminmod/centminmod · GitHub So you might have doubled up on .php location matches if you have include file loaded + your above php location matches.

    bottom of /usr/local/nginx/conf/conf.d/newdomain.com.conf
    Code:
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
     
  3. fhuard

    fhuard New Member

    3
    1
    3
    Jul 30, 2015
    Ratings:
    +1
    Local Time:
    9:27 AM
    Oh I see, I will try to verify this. Keep you posted.

    Cheers,
    Franco