weird caching behaviour

Maxim Dounin mdounin at
Tue Feb 21 14:37:33 UTC 2012


On Tue, Feb 21, 2012 at 09:27:51AM -0500, Dipl.-Ing. Juergen Ladstaetter wrote:

> Hi guys,
> we're running a load balanced cluster with nginx as load balancing software
> and use the caching feature. So far we're caching for 3 high frequent sites
> and it's working great.
> Now when I add another site to be cached (configuration is below) nginx
> starts to cache EVERY website that it's loadbalancing. Can you find an error
> in the configuration or tell me why it's doing this? Thanks in advance.
> Nginx.conf:


> 	# include all vhosts
> 	include sites-enabled/*;
> }
> Default vhost without caching that catches all non-specific requests:
> 	# standard load balancer
> 	server {
> 		listen 		SYSserver:80;
> 		server_name	_;

This is *not* default vhost, as you don't have "default_server" 
option in listen directive, and order isn't guaranteed due to 
"include sites-enabled/*" used.


    listen SYSserver:80 default_server;

should fix your problem.

More details may be found here:

Maxim Dounin

More information about the nginx mailing list