Адаптация правил из .htaccess MajorDoMo для nginx.
server { listen *:80; server_name brain, brain.example.com; index index.html index.htm index.php; access_log /var/log/nginx/brain.example.com_access.log; error_log /var/log/nginx/brain.example.com.ua_error.log; location / { root /var/www/brain; try_files $uri $uri/ @smarthome; } location ~ \.php$ { root /var/www/brain; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; } location @smarthome { fastcgi_pass unix:/var/run/php5-fpm.sock; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME /var/www/brain/nf.php; fastcgi_param SCRIPT_NAME /nf.php; fastcgi_param QUERY_STRING $args; } }