location /sitebuilder/api {
	alias /usr/local/sb/htdocs;
	try_files $uri @sitebuilder;
}

location /sitebuilder {
	alias /usr/local/sb/htdocs;
	index index.php index.html;
	try_files $uri $uri/ @sitebuilder;

	location ~* /sitebuilder/sites/(.*)/attachments/documents/(.*) {
		deny all;
	}

	location ~* /sitebuilder/(.*)\.php$ {
		include /etc/sw-cp-server/fastcgi.conf;
		fastcgi_pass unix:/var/run/sw-engine.sock;
		fastcgi_param SCRIPT_FILENAME $request_filename;
	}
}

location @sitebuilder {
	include /etc/sw-cp-server/fastcgi_params;
	fastcgi_pass unix:/var/run/sw-engine.sock;
	fastcgi_param PATH_INFO /sitebuilder/$fastcgi_path_info;
	fastcgi_param SCRIPT_FILENAME /usr/local/sb/htdocs/index.php;
}
