Nginx Frontend Proxy Is Caching The WordPress Admin Area, How To Exclude?

open4biz

Verified User
Joined
Mar 22, 2009
Messages
107
Cheers Everyone,

I recently migrated from an older DA setup to one of the new DA stacks and discovered that the nginx frontend proxy (nginx+apache) is caching my WordPress sites' admin area. How can I exclude the WordPress backend so when I update plugins and whatnot I can see that the updates actually occurred? Related question: when I tried to update several things at once I encountered a timeout issue on the same sites. Any help clearing up these two issues would be appreciated!

I found a bit of DA documentation which looked like it was headed in the right direction:

http://help.directadmin.com/item.php?id=562

And these caching rules looked promising (see the wordpress.cache.conf section):

https://vpsboard.com/topic/108-nginx-wordpress-with-caching/

Would there be a way to use the rules with DA's nginx frontend proxy?

Cheers!
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
Hello,

Are you using PHP with Zend OpCache? If so, then it's Zend OpCache which caches your pages, not nginx.
 

open4biz

Verified User
Joined
Mar 22, 2009
Messages
107
No, I am not using Zend OpCache, just the nginx front end proxy.
 
Last edited:

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
By default nginx installed by custombuild does not cache anything. You see the cached pages from your browser cache probably, or there is other point on your server which shows cached results.

- A Guide to Caching with NGINX
https://www.nginx.com/blog/nginx-caching-guide/

While using nginx as proxy you can use ngx_http_proxy module directives to enable/disable and manage caching in nginx:

- Module ngx_http_proxy_module
http://nginx.org/en/docs/http/ngx_http_proxy_module.html

Customization to nginx can be done either globally by modifying templates http://help.directadmin.com/item.php?id=558 or per domain bases using directadmin Web-UI http://help.directadmin.com/item.php?id=3
 

open4biz

Verified User
Joined
Mar 22, 2009
Messages
107
I am confused. I mentioned i am using the nginx front end proxy ahead of Apache, but you're saying the front end proxy doesn't cache anything by default? What's is its purpose then?

Edit: Alex, I read through your post on the subject and I'm still confused why I would want an nginx front end if it's not going to help me spit pages out of the server faster. Is it a load balancer? Are there any other benefits?

Source: http://help.poralix.com/articles/reverse-proxy-nginx-apache-with-custombuild2-directadmin

Cheers!
 
Last edited:

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,067
With the nginx/apache proxy setup, first nginx reads the request.
The request is then passed to apache. *All* requests are passed to apache, allowing things like .htaccess overrides/redirects, etc..
There is an apache module (mod_aclr2), which then decides what to do with the request.
If it's a static file, the request is then sent back to nginx, but /nginx_static_files/ is prepended to the front of the URL, so that nginx then serves the static file directly.

This has nothing to do with caching per se, just to do with the fact that nginx is quite fast at serving up static files.
You can add other things to it as you want, but the base setup is fairly bare-bones.

John
 
Last edited by a moderator:
Top