Running on Nginx
The Turning Gate fully supports Backlight on Apache servers running on Linux.
Some customers prefer to host on other web servers, such as IIS and Nginx. While Backlight should work in those environments, we do not have the resources to fully test Backlight in environments beyond Apache/Linux. As such, any support is provided on a best-effort basis.
Backlight should run on Nginx web servers with no modification to the code itself. It is essential that the site be configured properly on the web server, in particular to protect data files and digital purchases from direct downloads.
Configuration of Nginx to run PHP, and general site configuration is beyond the scope of this page.
Setting up Backlight on Nginx is performed in two steps:
- Configuring Nginx to protect data and cart purchase directories
- Optionally, configure Backlight to use Clean URLs for Page and image links
#
Configuring NginxBelow are entries to be added to your Nginx server configuration for Backlight compatibility. These assume that your site is running at the root, and not in a subdirectory, e.g. at http://yoursite.com/
Below is a complete server configuration for a website that incorporates the above additions. This assumes that Backlight is running directly under the top-level of your site. Change the settings for the server name, website paths and location of log files to be specific to your hosting environment.
#
Configuring Backlight to support Clean URLsBacklight 2 is able to automatically detect that clean URLs should be used on Nginx installations. If your Backlight 2 site is not using clean URLs, then this can be forced with the following change.
To force generation of clean URLs:
- Copy or rename the file backlight/env.php.skel to backlight/env.php on your server
- Uncomment the setting for FORCE_CLEAN_URLS near the end of that file by removing the leading
//
, so that the line reads: