I use PHP with the Phalcon framework in my projects and this is the framework.
Mynginxlookslikethis:
server{listen80;server_name123.123.123.123;root/var/www/meusite.com.br;location@site{rewrite^/public(.+)$/public/index.php?_url=$1last;}location/{indexindex.php;if($uri!~^/public){rewrite^(.*)$/public$1;}try_files$uri$uri/@site;location~*^/(css|img|js|flv|swf|download)/(.+)${root/var/www/meusite.com.br/public;}}location~\.php${try_files$uri=404;fastcgi_split_path_info^(.+\.php)(/.+)$;fastcgi_passunix:/var/run/php5-fpm.sock;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;includefastcgi_params;}location~/\.ht{denyall;}}
It'sworkingfine,butnowwhenaninternalfolderisrequested,Ineednginxtoignorethewhole"location /" and run the same "location /" commands inside the requested folder. For example / v2 / .
How do I do this? I've tried it in many ways. I already searched Google. Anyway, my biggest problem is because Phalcon uses a different folder structure than the common one.