We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

nginx routing problem

Hi! I've just uploaded my website to remote nginx-based system and my routing simply does not work. All page links gos to main page (seems like nothing happens and nothing routed). I've tried all nginx configs which are in documentation with no luck. There are no errors in logs. baseUri settings didn't help also. What's wrong?

I am working only with nginx, and everything works ok. Check my config:

server {
        server_name domain.tld;
        root /home/domain.tld/public;
        index index.php index.html index.htm;

        error_log /home/domain.tld/error.log;

        location / {
        try_files $uri $uri/ /index.php?&$args;

        location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/home/domain.tld/domain.tld.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param PHP_VALUE "open_basedir = /home/domain.tld:/tmp";

php-fpm pool

listen = /home/domain.tld/domain.tld.sock
user = www-data
group = www-data
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
chdir = /


$router = new Phalcon\Mvc\Router();



return $router;

I have just added my $router.php to my last post


Seems you do not have correct configuration in your nginx setting. Paste your nginx server block.

I have exactly the same config as posted in docs (tried all of them). Now I temporarily use Apache but it seems I need to set up 'setUriSource'. I will try to check this when I reach my server next time.