Forum: NGINX Etags and Load-balanced environmetn

8ae5d55bec912089ed97de209c3cfda4?d=identicon&s=25 Lau Buru (lauburu)
on 2014-05-28 18:55
Hi,

I've got 3 NGinx servers running under a load balancer. I've got ETags
successfuly configured but the problem is that each server presents
different ETag tag for the same content:

  ETag: "531ee076-6b"
  ETag: "531edf6a-6b"
  ETag: "531ede5f-6b"
  ETag: "531edd4f-6b"

I've read that NGinx is using inode for calculating the ETag so it's
obvious that we will never get the same ETag for the same file in
different servers. I know I could get this if I use shared disk but this
is not an option for me.

I wonder if it's on schedule to implement FileEtag directive as exists
in Apache (http://httpd.apache.org/docs/2.0/mod/core.html#fileetag),
this would solve these kind of problems.

Thanks a lot,
Lau Buru
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-05-28 19:25
(Received via mailing list)
Hello!

On Wed, May 28, 2014 at 06:55:17PM +0200, Lau Buru wrote:

> Hi,
>
> I've got 3 NGinx servers running under a load balancer. I've got ETags
> successfuly configured but the problem is that each server presents
> different ETag tag for the same content:
>
>   ETag: "531ee076-6b"
>   ETag: "531edf6a-6b"
>   ETag: "531ede5f-6b"
>   ETag: "531edd4f-6b"

That's because you've failed to sync file modification time between
servers.

> I've read that NGinx is using inode for calculating the ETag so it's
> obvious that we will never get the same ETag for the same file in
> different servers. I know I could get this if I use shared disk but this
> is not an option for me.

You've read something totally wrong.  If you can remember where
you read it, add the source to your blacklist (and you may also
share it for others to do the same).

> I wonder if it's on schedule to implement FileEtag directive as exists
> in Apache (http://httpd.apache.org/docs/2.0/mod/core.html#fileetag),
> this would solve these kind of problems.

The default and the only option is to use file modification time
and size.  Problems with inode number are well known and were
avoided in nginx from the initial introduction of the entity tags
support.

--
Maxim Dounin
http://nginx.org/
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.