concrete5 on Nginx
Permalink
Hey everyone! Recently I've learned how to run nginx and was going to start deploying sites in it. Has anyone tried deploying c5 in nginx before? Is it pretty much the same or is there some specialties regarding it over apache.
Thanks,
David
Thanks,
David
I'm using both NGINX and Apache to get the best from both. Here's my setup:http://mlocati.github.io/articles/nginx-apache-concrete5.html...
I just went for a single nginx setup. I'm running the site on NixOS as a server, so the entire computer is dedicated to running one site. Each of my customers gets a vm and I deploy their site with a NixOS configuration file. I had the best luck getting concrete5 to run on nginx using the info here:https://stackoverflow.com/questions/11226624/deploying-concrete5-on-...
Then I came up with the NixOS side of things for a succesful deployment. It was so exciting see that concrete5 install screen again after being away from c5 development for almost a year!
Then I came up with the NixOS side of things for a succesful deployment. It was so exciting see that concrete5 install screen again after being away from c5 development for almost a year!
NGINX's Config looks very different, I'll explain:
This defines the expiry date for different content types. You can also set it later
Here you define to what ports and which domains the server should listen to. I use Letsencrypt certificates, so all requests to port 80 (HTTP) will be directed to the HTTPS Domain (return 301) UNLESS it is in the subdirectory of /.well-known, this will respond to HTTP calls als Letsencrypt needs that directory to renew the certificates
This is the server block for HTTPS requests that point to the server directory in which your concrete5 installation lives. (root/…)
We tell NGINX to respond to all calls that contain index.something
And afterwards we link to the Letsencrypt certs. Obviously you need to comment all that out until you got your certificates in the right place. Within the Letsencrypt lines we define which connections shall be accepted (TLSv1.2, TLSv1.1 TLSv1) and which Ciphers shall be used, as well as Diffie-Hellman-Method. You need to uncomment the "Strict Transport Security" line if you work on a dev doman.
The following location blocks define where your PHP and FastCGI sits, and this is for PHP7.0* so maybe you need to adjust for your version. Everything else should be pretty self-explanatory.
Put this into /etc/nginx/sites-available/your-domain-name.com and set a symbolic link to that file in /etc/nginx-sites-enabled. (ln -s /etc/nginx/sites-available/your-domain-name.com /etc/nginx-sites-enabled/ )
Don't forget to make your server root accessible for the nginx user (chown -R www-data:www-data /var/www/your-domain-name.com/ )
Restart nginx after that and it should be working.