New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Disable varnish on xenforo 2

Started by MAMAC, December 06, 2018, 03:53:42 PM

Previous topic - Next topic

MAMAC

Hello, im trying to disable varnish on xf2, i try many things that i find on google but nothing works. i still have varnish on xf. Problem is that varnish doesent work ok with xenforo admin panel. he logout u as admin every time u click something in panel.

madmax

Could you not use the "WebServers Domain Conf" in admin panel and set just that domains config to not use varnish, like i have some sites that use just apache, some that use nginx + varnish and some that use all three and never get any issues

MAMAC

#2
I have on same domain wordpress and /forum is xenforo... so i dont want to disable varnish for wordpress only for subfolder.

i try many things in /etc/varnish/ including in hosts i add

if (req.url ~ "^/\forum/") {
      return (pass);
   }

i try like everything that i find on net but it seems like it doesent apply... i even try to reboot machine after changes...


EDIT:

http://prntscr.com/lrlk2y

madmax

I would say that maybe you can add the forum as a sub domain and change the config for just the forum forum example domain.com has varnish enabled and then forum.domain.com has a separate just apache ?

MAMAC

that is a last solution to change to subdomain :P

madmax

Quote from: MAMAC on December 07, 2018, 10:32:48 AM
that is a last solution to change to subdomain :P

i get that, after doing a bit of googling people are saying that it could take some time for it to take effect etc, try restarting the server or at least varnish Apache etc and of course make sure you dont have a cached version of the site, try also using the full path the the folder maybe i dont know exactly but here is what i read.

https://stackoverflow.com/questions/49012502/how-to-make-varnish-not-cache-a-certain-folder

monkeyking

Quote from: MAMAC on December 06, 2018, 04:46:57 PM
I have on same domain wordpress and /forum is xenforo... so i dont want to disable varnish for wordpress only for subfolder.

i try many things in /etc/varnish/ including in hosts i add

if (req.url ~ "^/\forum/") {
      return (pass);
   }

i try like everything that i find on net but it seems like it doesent apply... i even try to reboot machine after changes...


EDIT:

http://prntscr.com/lrlk2y

try pipe instead of pass
if (req.url ~ "^/\forum/") {
return (pipe);
}