nginx下利用phcalcon生成框架的重写规则

server {
        listen       80;
        server_name  phalcon.test.com;
        charset      utf-8;
        index index.php index.html index.htm;
#       set $root_path '/usr/share/nginx/falcon/invo/invo/public';
        set $root_path '/usr/share/nginx/falcon/invo/test/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/test/public$fastcgi_script_name;
                        include fastcgi_params;
        }




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


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

你可能感兴趣的:(nginx下利用phcalcon生成框架的重写规则)