Expression Engine

Setting Up Expression Engine Under NGINX


I am a big fan of Expression Engine for standard CMS style needs, the only issue is that the .htaccess for mod_rewrite will obviously only work on an Apache server, so when hosting on an NGINX box, I normally use this config.

You can add the server{} block inside your http{} block but I included it for clarity.

Please remember to change the example.bonbon.io in the file to reflect your server_name and folder structure

To check the config before you restart, run this command, please do this and make sure the syntax is OK before you restart or the web server will not like it at all!

$ sudo /usr/sbin/nginx -t

That will inform you of any syntax errors, before you restart with:

$ sudo /usr/sbin/nginx -s reloadhttp { server { listen 80; server_name example.bonbon.io; access_log /var/log/nginx/example.bonbon.io-access.log; error_log /var/log/nginx/example.bonbon.io-error.log info; root /var/www/example.bonbon.io; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } # Deny all attempts to access hidden files location ~ /\. { deny all; access_log off; log_not_found off; } location / { index index.html index.htm index.php; try_files $uri $uri/ /index.php?$args; add_header 'Access-Control-Allow-Origin' '*'; } location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { expires max; log_not_found off; } location ~ \.php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } }

Please feel free to suggestions or improvements, but this works great for my own needs, and with the volume of suggestion configs out there, I wanted to share the one I use.

A tech native with 20 years of experience across the digital space. Darryl is an evangelist for the power and disruption of blockchain technologies and fosters a passion for bringing ever greater utility and adoption to the masses.

Related Articles

Exploring AI Art with Midjourney: A Handy Cheat Sheet

CTO-as-a-Service

Driving Startup Success: The Impact of CTO-as-a-Service

Embracing Web3: Safeguarding Data Privacy in the Transparent Digital Era

Copyright © 2016-2024 Bonbon Group Ltd. All Rights Reserved.