In this article we list steps of basic Nginx configuration, in PROXY mode, with SSL. Nginx works as SSL terminator and proxies all requests to Apache port 80. In this recommended mode SSL certificate has to be installed in advance via cPanel SSL function.
Why Nginx in proxy mode with SSL
Nginx caching modes
– login to cPanel and click XtendWeb Nginx control link
Configuring a domain in Nginx Proxy mode with SSL
In such configuration we recommend that you disable any SSL redirection functions in Apache.
Drupal specific instructions to disable SSL redirection
If you run Drupal, you will have to disable securepages module, or your website will not load.
For Drupal 7, add the following to your settings.php file
$conf["https"] = TRUE; $base_url = "https://[your-website-full-url]"; // Do not add / at the end.
If you have redirection to
www. in your
.htaccess file, make sure the
$base_url variable includes
www. in the URL of your website.
Configuring Nginx as SSL terminator in Proxy mode
- Click Nginx link (see above)
- Select domain to manage and click Configure button
- Enable redirect to SSL option as in this screenshot and submit your changes
- Check your website is operational via SSL (https://yourdomain.com). If your website does not load due to a redirect loop, reconfigure Nginx to disable the ‘redirect_to_ssl’. To reconfigure Nginx, click the XtendWeb logo in the top of the page (see the above screenshot)