Phalcon and nginx - framework run only indexController

后端 未结 2 1440
抹茶落季
抹茶落季 2021-01-24 06:08

I am using Phalcon and Nginx, and i have a problem. When I go to http://myapp.dev/segmentation Phalcon should run SegmentationController and its indexAction() method. But instea

相关标签:
2条回答
  • 2021-01-24 06:29

    USe this config

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

    Working Config

    0 讨论(0)
  • 2021-01-24 06:51

    Its the problem with location directive

    Use this configuration.

    location / {
            root   $root_path;
            index  index.php index.html index.htm;
    
            # if file exists return it right away
            if (-f $request_filename) {
                break;
            }
    
            # otherwise rewrite it
            if (!-e $request_filename) {
                rewrite ^(.+)$ /index.php?_url=/$1 last;
                break;
            }
    

    Hope this helps!

    Happy Coding !!!

    0 讨论(0)
提交回复
热议问题