Try CumulusClips Cloud Hosting

How to use CumulusClips with Nginx

edited August 2016 in How-Tos
I've seen requests for Nginx server configs rather than Apache and although it's not *officially* supported, it does work just fine with Nginx so I thought I'd write a little how to.

This guide is for Debian and its derivatives but can be very easily adapted depending on your Linux flavour.

For your reference, the general installation guide for CumulusClips is here:
http://cumulusclips.org/docs/installation/

Let's begin!

Note:
This guide presumes you have installed and setup Nginx, MySQL and PHP-FPM as well as the "PHP Modules" and "PHP Settings" from the CumulusClips guide above.
If you have not, you can follow this guide here, up to step 6 then continue with this guide.
https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04

1. Edit your default Nginx config file, or create a new one. sudo nano /etc/nginx/sites-available/default

Presuming your CumulusClips is extracted to:
"/var/www/html/cumulusclips"
and your domain name is: "example.com" redirecting to "www.example.com".
Using the following config, change 'server_name' and 'root' where needed.

server {
listen 80;
server_name example.com;
return 301 http://www.example.com$request_uri;
}

server {
listen 80;
server_name www.example.com;

client_max_body_size 2048M;

root /var/www/html/cumulusclips;
index index.php index.html index.htm default.html default.htm;

location / {
try_files $uri $uri/ /index.php?q=$uri&$args =404;
}


location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}


"client_max_body_size 2048M;" means a 2GB limit per file upload.
Changes to this will also need to be reflected in the php-fpm's "php.ini" file.
See the "PHP Settings" paragraph from http://cumulusclips.org/docs/requirements/ and also the "PHP Requirements" will need to be fulfilled.

Once saved, run sudo service nginx restart.
It should now be working with Nginx and no Apache to be seen! :)

This discussion has been closed.