phalcon 的 nginx rewrite 规则

跟进官方的教程测试了一天,最后还是找到了可以使用的nginx 规则。


server {
        listen       80;
        server_name  falcon.test.com;
        charset      utf-8;
        index index.php index.html index.htm;
        set $root_path '/usr/share/nginx/falcon/invo/invo/public';


        root $root_path;


        #location / {
        #       try_files $uri $uri/ /index.php;
        #}


        try_files $uri $uri/ @rewrite;


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


        location ~ \.php$ {
                        try_files $uri =404;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass 127.0.0.1:9000;
                        fastcgi_index index.php;
                        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/falcon/invo/invo/public$fastcgi_script_name;
                        include fastcgi_params;
        }




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




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

你可能感兴趣的:(phalcon 的 nginx rewrite 规则)