Wordpress and varnish issue breaking loadcript.php

I got trapped with varnish - Nginx - Wordpress. There are several Joomla based sites running on the server (everything is fine) and one Wordpress should be running, apart from being torn apart with varnish.

Basically, when Varnish is enabled I get the following error:

Uncaught ReferenceError: _ is not defined

in the control panel and various jQuery errors not defined elsewhere.

With varnish, everything works fine. Now I am scratching my head where the problem is with the creation of my polish. I cannot find anything on the internet that is a similar problem and any help would be appreciated!

+3


source to share


2 answers


I just came across this question today. You haven't posted your config, but I'm guessing you can use querysort

to normalize query parameters.

I found I querysort

really didn't like the URL load-scripts.php

. In many cases, this results in URL truncation. If you are using it, I recommend either not using it or making a special condition for it, for example:



if (req.url !~ "load-scripts\.php") {
  set req.url = std.querysort(req.url);
}

      

+4


source


In response to Carl, I found that stopping querysort

for everything wp-admin helped with this error in other plugins.



if (req.url !~ "wp-admin") {
  set req.url = std.querysort(req.url);
}

      

+1


source







All Articles