Skip to content

Phalcon + nginx + php_fpm #22

@netandreus

Description

@netandreus

Hello, how can i setup phalcon test app in nginx environment?
I receive this error message:

Mod-Rewrite is not configured!
Seems that your mod-rewrite module is missing or not configured. Enable it to get this application working properly.

Phalcon installed at /home/andrey/sandbox/phalcon.dev
nginx config:

server {
    listen 80;
    server_name phalcon.dev;
    set $root_path '/home/andrey/sandbox/$host';
    root $root_path;

    access_log /var/log/nginx/$host-access.log;
    error_log  /var/log/nginx/phalcon-error.log error;

    index index.php index.html index.htm;

    try_files $uri $uri/ @rewrite;

    location @rewrite {
        rewrite ^/(.*)$ /public/index.php?_url=$1;
    }   

    location ~ \.php {
        # try_files $uri =404;

        fastcgi_index /public/index.php;
        fastcgi_pass 127.0.0.1:9000;

        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
    root $root_path/public;
    }

    location ~ /\.ht {
        deny all;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions