nginx and plugins of break

Without a doubt nginx is one of the best existing Web servers nowadays, but its configuration has to become by means of a configuration file that, by general norm, cannot be modified to the flight.

This means that when plugin settles of breaks the changes cannot be applied as in Apache httpd or others by means of the file .htaccess, so that plugin cannot make the corresponding changes to be useful breaks it.

When activating plugin will begin to store the files in the corresponding folders, reason why we must cause that nginx calls to that breaks previous to execute the normal commandos.

Plugin exists very simple of breaks Simple call Breaks. This plugin manages breaks it and its changes and directly creates a URL structure on the system of files. Of this form it breaks it is in a direction similar to this:

/wp-content/cache/simple-cache/example.com/hello-world/index.html

In this case, the habitual folder is used of breaks of WordPress, followed of the name of plugin and, next, the structure of the URL.

nginx by defect executes the following call:

location/\ {try_files $uri $uri//index.php? $args; }

This means that it analyzes the URL, verifies if the file really exists (and if it exists gives back it) and, on the contrary, always call finishes index.php. This operation is the same that makes the code that by defect is added .htaccess.

In order to make that it is tried to try the call to it breaks it first to see if already it exists, we have a simple formula, adding these two previous elements:

location/\ {try_files €œ/wp-content/cache/simple-cache/$ \ {http_host} \ {request_uri} index.html€ $uri $uri//index.php? $args; }

This system would only work in the case in which the permanent connections are formed of the following form:

/(loquesea)/%postname%/

In the initial part it is possible to be formed what it is wanted, but the last parameter has to be finished %postname% in final bar.

In case the permanent connections do not have the final bar, the following code would be due to use:

location/\ {try_files €œ/wp-content/cache/simple-cache/$ \ {http_host} \ {request_uri} /index.html€ $uri $uri//index.php? $args; }

If plugin, as it is the case, allows to activate the option of Gzip, you will have to deactivate it since nginx or takes this system activated by defect, reason why the data will keep planes and nginx or will execute the best option.

It lets a commentary