Welcome! Log In Create A New Profile

Advanced

Problem with try_files

Posted by Zoron 
Problem with try_files
January 20, 2019 12:43PM
Please tell me how you can specify the path to the necessary file in try_files in nginx for wp-rocket to output static files in wordpress.
The latest version of wp-rocket forms the next path to the static file -
wp-content/cache/wp-rocket/site.com/sterilisation-kitten/q=%2fsterilisation-kitten%2f/index.html

the wp-rocket manual contains the following code for nginx:

location / {
try_files /wp-content/cache/wp-rocket/$http_host/$cache_uri/index.html $uri/ /index.php?$args;
}

but nginx doesn't see it because there's another folder "q=%2fsterilisation-kitten%2f"

If I do that:
location / {"pos(192,210)}and the location / {{"pos(192,210)}.
try_files /wp-content/cache/wp-rocket/$http_host/$cache_uri/q=%2f$cache_uri%2f/index.html $uri/ /index.php?$args;
}

doesn't work :(

Please tell me how to do it correctly. Or just how to use a regular expression like to take any folder ".*"
Thank you.



Edited 1 time(s). Last edit at 01/20/2019 12:43PM by Zoron.
Re: Problem with try_files
January 20, 2019 07:07PM
the problem is that the $cache_uri variable contains / instead of %2f. How to remove / from the variable? or how to make sure that nginx does not convert / to %2f when saving?



Edited 1 time(s). Last edit at 01/20/2019 07:09PM by Zoron.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready