Misc

In case of error with the module or a website, here is some information that will be useful to find the source of the problem.

Installation

Sometimes Apache will takes too long to close therefore Nginx can not run on port 80 because since it is still in use. When this problem happens, just force Apache to stop and restart Apache and Nginx.

If the installation was closed by mistake or seems to stuck in a loop, first check with the "top" tool to make sure it does not do anything. Write down the PID number and kill the process. Then restart it.

Ports

When the acceleration module is enabled, Nginx will use port 80 and port 443 and Apache will use port 8080 and port 8443. If you want to set up the cache on a site and you see abnormal behavior, you can unblock the Apache ports in the firewall. You will then be able to compare a site with cache and without cache, without having to disable and re-enable caching.

Cloudflare

When you use Cloudflare free SSL certificate without having one on your hosting, you must choose to CloudFlare "flexible" SSL mode. However, this mode is problematic with the caching module. The problem is not related to caching, but with the redirection that occurs when communicating between Cloudflare and Nginx servers.

What is the cause of the problem?

When a site uses a flexible Cloudflare certificate, communication between the visitor and Cloudflare is secure, but communication between Cloudflare and the website is not.

Visitor--- HTTPS ---> Cloudflare --- HTTP --- > Website

Several CMS (Content Management System), like WordPress, may encounter infinite loop problems with this type of communication since they should normally always be accessed using HTTPS (in secure mode). So this creates the following scenario:

  1. The visitor requests the page: https://example.com (with HTTPS)
  2. Cloudflare receives the request for https://example.com (with HTTPS)
  3. Cloudflare communicates with the web server on http://example.com (without HTTPS)
  4. The site receives the unsecured request from Cloudflare.
  5. The site redirects the request to https://example.com (with HTTPS)
  6. Return to point number 2 and the loop continues endlessly.

Two solutions are possible to solve this problem.

  • Change the type of certificate used at Cloudflare from "flexible" to "full" AND install an SSL certificate on the site, whether it is self-signed or issued by a CA.
    or:
  • Add the line "$ _SERVER ['HTTPS'] = 'on'; "(Without the" ") in the configuration file of your CMS. For WordPress, insert this line in the "wp-config.php" file.
Sidebar