Drupal installation in nginx subdirectory I have a new application that will be made of 2 frameworks yii and drupal 7

Yii framework will be in the root (/)

and drupal will be in a sub directory called admin (/admin)

I have a problem how to config it in nginx,drupal doesn't work,it gives me access denied,or just the home page and no link works

This is my configuration file in nginx

server {
        listen 80;
        server_name demo.example.com;
        root /home/www/example;
        index /index.php;


        location / {
                if (!-f $request_filename) {
                        rewrite ^(.*)$ /index.php?q=$1 last;
                        break;
                }
        }
        location /admin {
                root /home/www/example/admin;
                index  index.php index.html;
                try_files $uri $uri/ @rewrite;
        }
        location @rewrite {
                rewrite ^/(.*)$ /admin/index.php?q=$2 last;
        }
        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
                index /index.php;

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

}
I had a similar scenario, but in my case I didn't need to define again the root folder for the Drupal installation as you do on location /admin. 

In my case I only needed to add the nginx directives for the Drupal path:

location /admin {
    try_files $uri $uri/ @rewrite;
}   


location @rewrite {
    rewrite ^ /admin/index.php;
}