Config Lcd CMS on Nginx - 8bitbase/phalcon-lcd-cms GitHub Wiki

๐Ÿ‘ป๐Ÿ‘ป๐Ÿ‘ป Hello some one read me! Let's go step by step below ๐Ÿ‘ฝ๐Ÿ‘ฝ๐Ÿ‘ฝ

  1. ๐Ÿ‘ฃChange directory to path: /etc/nginx/conf.d/
  2. ๐Ÿ‘ฃCreate new config with extend .conf
  3. ๐Ÿ‘ฃContent of config:
server {
    listen 80;
    server_name project-url;
    root /path/project/public;
    index index.php index.html index.htm;

    location / {
        if ($request_uri ~ (.+?\.php)(|/.+)$ ) {
            break;
        }

        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php?_url=/$1;
        }
    }

    location ~ \.php {
        fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        set $real_script_name $fastcgi_script_name;
        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
            set $real_script_name $1;
            set $path_info $2;
        }
        fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
        fastcgi_param SCRIPT_NAME $real_script_name;
        fastcgi_param PATH_INFO $path_info;
    }

    access_log  /path/logs/project/access.log  access;
    error_log  /path/logs/project/error.log;
}
  1. ๐Ÿ‘ฃAfter save, restart Nginx service.
CentOS 7: systemctl restart nginx
CentOS 6: service nginx restart

Final, thanks to view my document! ๐Ÿ™‡๐Ÿ™‡๐Ÿ™‡๐Ÿ™‡