We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Nginx + Phalcon + php5-fpm + shared server

I had an Apache server and migrated it to nginx , for performance reasons . In apache, I had only edit the .htaccess arquvos and everything flowed perfectly fine.

On this server I have some folders with PHALCON projects and other simple PHP code.

Someone who understands the nginx configuration, give me a light, for this to work for both the Phalcon and for others PHP code ?

i think the way is

server {

    root /bla/bla/bla;
    location/ {
        ...
    }

    location /project_phalcon_one {
        root /bla/bla/bla/phalcon/public; ??
    }

    location ...php{
        ...
    }

    location (images and else) {
        ...
    }
}

Any idea will be appreciated.



3.9k

Sorry but i doesn't work! For this two htaccess used by phalcon i'll have this codes translated:

location /project_phalcon_one  {
    root   /var/www/project_phalcon_one /public;
    rewrite ^/$ /public/ break;
    rewrite ^(.*)$ /public/$1 break;
}

location /project_phalcon_one /public {
    root   /var/www/project_phalcon_one /public;
    if (!-e $request_filename){
    rewrite ^(.*)$ /index.php?_url=/$1 break;
    }
}

All php codes in server works on, but my phalcon folder i got this:

404 Not Found

Believe me: I have tried all posted codes inside this foreum on that and still doesn't work. I need someone who has this "hybrid" local server running to help me.



4.0k

Try change by documentation Nginx Installation Notes



3.9k

I have a solution that works in here too. But at this time i create an entire config for Ajenti server admin.

For someone that are looking for solutions this is the link:

https://forum.phalcon.io/discussion/14443/phalcon-on-ajentiv