So, I'm not an expert on Blesta or NGINX, but I have learned the easy way to make the two work and wanted to share. Credit to cloudrck for starting the project on github (I have used a lot of his work in the config.)
1.) Fire up a fresh install of Ubuntu 14.04 64-Bit (DigitalOcean works great for testing)
2.) Install EasyEngine (easy way to setup a LEMP server)
curl -sL rt.cx/ee | sudo bash
ee system install
3.) Create your site with EasyEngine
ee site create youdomainname.com --mysql
4.) Install Ioncube
cd /usr/local
sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
mv /usr/local/ioncube/* /usr/lib/php5/20121212/
nano /etc/php5/fpm/php.ini
zend_extension = /usr/lib/php5/20121212/ioncube_loader_lin_5.5.so
service php5-fpm restart
5.) Apply PHP 5.5 Hotfix
Prepare your files before you upload. Copy the "blesta" folder from the PHP5.5 Hotfix folder to the main "blesta" folder. This will overwrite the files that need to be replaced.
Zip up your "blesta" folder contents and upload to your new server instance.
6.) Edit your NGINX Conf
cd /etc/nginx/sites-available/
cp *yourdomain.com *yourdomain.com.backup
nano
You can use the following NGINX config as a starting point (it should work out of the box for you after you edit the paths.)
# MYSQL NGINX CONFIGURATION
server {
listen 80;
listen 443 ssl;
server_name *your FQN*;
access_log /var/log/nginx/*log directory & file* rt_cache;
error_log /var/log/nginx/*log directory & file*;
root *local directory for Blesta install*;
index index.php index.htm index.html;
server_name *your FQN*;
ssl_certificate *SSL Cert File*.crt;
ssl_certificate_key *SSL Key File*.key;
location / {
error_page 404 = @blesta; #IF file doesn't exist
log_not_found off;
}
#Core rewrite
location @blesta {
rewrite ^(.*)$ /index.php last;
# rewrite ^(.*)$ /index.php/(.*) /$1 permanent;
}
location ~ \.php$ {
try_files $uri =404;
# Tweak for Nginx to work with PHP from vendors
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
# Buffer settings increase to compensate for increased time/size due to SSL
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k; #
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_pass php;
fastcgi_index index.php;
include fastcgi_params;
}
# Disallow access to any file with .pdt extension
location ~ (\.pdt) {
return 403;
}
if (!-e $request_filename){
rewrite ^(.*)$ /index.php;
}
#Core rewrite
location @blesta {
rewrite ^(.*)$/index.php/(.*) /$1 permanent;
}
include common/locations.conf;
}
Now save the file as *yourdomain.com (Press CRTL-X, then Y and type it in.)
This should have overwritten the current config (the one you just made a backup of.)
7.) Test & Restart NGINX
nginx -t
(if all goes well, you will see successful)
If successful, then restart
service nginx restart
8.) Set database password and create a database (assuming using root user for this tutorial)
mysqladmin -u root password YOURnewPASSWORD
mysql -u root -p
*ENTER PASSWORD*
create database DATABASEname;
flush privileges;
exit
9.) Install Blesta
Follow installation instructions.
10.) Make the SEF URL's work
cd /var/www/*yourdomain.com/htdocs
nano lib/init.php
Find the HTACCESS line and replace with this:
define("HTACCESS", true);
Note: This tutorial does not address security or hardening in any way. I will leave that up to you. I am simply sharing a good starting point to get Blesta up and running. I'm using Ubuntu in this instance as it works great for starting out with EasyEngine and UFW.
Feel free to add to this and let me know if I have missed anything!