I tried to learn and configure phalcon by testing [INVO sample application](http://blog.phalconphp.com/post/20928554661/invo-a-sample-application)

It appears that the tutorial doesn't include nginx config for the testing so that I got some difficulty to test the sample application.

I used nginx as the web server, I took nginx configuration from [here](http://docs.phalconphp.com/en/latest/reference/nginx.html)

Here is my nginx config:

```
server {

    listen   80;
    server_name local.phalcon.dev;

    access_log /Users/mylocal/www/log/phalcon.access.log;
    error_log /Users/mylocal/www/log/phalcon.error.log;

    index index.php index.html index.htm;
    set $root_path '/Users/mylocal/www/phalcon/current';
    root $root_path;

    try_files $uri $uri/ @rewrite;

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

    location ~ \.php {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index /index.php;

        include /usr/local/etc/nginx/fastcgi_params;

        fastcgi_split_path_info       ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO       $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

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

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

```

Looking at the tutorial, I believe the structure is like this:

```
webroot
    invo
        app
            ...
        public
            index.php
            ...
        ...

```

which means, `webroot` is my `/Users/mylocal/www/phalcon/current`

and I should be able to access it with this url `http://local.phalcon.dev/invo`

It lead to 403 forbidden which is understandable because it appears that we should rewrite path from `webroot/invo` to `webroot/invo/public`

I did some trial and error changing the configuration but found no luck, can somebody help me to configure the nginx config for that tutorial? (which means accessing it from `http://local.phalcon.dev/invo`)

PS:

I was able to access it by changing the `$root_path` into `/Users/mylocal/www/phalcon/current/invoice/public`

and changing the `$url->setBaseUri($config->application->baseUri);` into `$url->setBaseUri('/');` in `invo/public/index.php`

but that means I accessed it from url `http://local.phalcon.dev` NOT `http://local.phalcon.dev/invo`