There is no real sub-directory, they are virtual folders created by rewrites; e.g. domain.com/search/keyword.html instead of search.php?q=keyword
Config is as
server { server_name .domain.com;
listen 80;
root /home/domain.com;
error_page 404 = /404.php;
index index.html index.php;
rewrite ^/search/(.*).html /search.php?q=$1 last;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /opt/nginx/conf/fastcgi_params;
}
}