Move files intended for web access to htdocs folder

Only index.php, api.php, css, js and img files will be available from web. This will secure config files and other site parts. 

Also i changed nginx config to be more compliant with nginx rewrite suggestions - http://nginx.org/en/docs/http/converting_rewrite_rules.html