# Nginx cakephp run subfolder

**URL:** <https://discourse.cakephp.org/t/nginx-cakephp-run-subfolder/6759>\
**Category:** Need Help\
**Created:** [October 15, 2019, 5:27am UTC](https://discourse.cakephp.org/t/nginx-cakephp-run-subfolder/6759 "2019-10-15T05:27:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimptit](https://avatars.discourse-cdn.com/v4/letter/k/a88e57/32.png) [@kimptit](https://discourse.cakephp.org/u/kimptit)\
**Post date:** [October 15, 2019, 5:27am UTC](https://discourse.cakephp.org/t/nginx-cakephp-run-subfolder/6759/1 "2019-10-15T05:27:07Z")

</div>

1

I am using cakephp 2 + winNMP (nginx+mariadb+php), I have successfully run the web on nginx. [http://localhost](http://localhost/) I want to run a similar cakephp code in a subdirectory. eg: [http://localhost/subfolder](http://localhost/subfolder) My directory structure is :

[link image](https://i.stack.imgur.com/kDWIA.jpg) Is config nginx :

```auto
    root "c:/winnmp/www/huyquangltd";
        autoindex on;
        location ~ \.php$ {
            #try_files $uri =404;
            include nginx.fastcgi.conf;
            include nginx.redis.conf;
            fastcgi_pass php_farm;
            fastcgi_hide_header X-Powered-By;
        }

        location / {
            try_files $uri $uri/ /index.php?$args;
        }

```

[http://localhost/](http://localhost/) \<-- ok [http://localhost/subfolder](http://localhost/subfolder) \<-- not ok

Please help me or have any ideas!

Thank you
