Can all Nginx vhosts use the same ssl_session_cache?

For me, Nginx docs on how it ssl_session_cacheworks are a bit unclear. I am wondering if this is:

ssl_session_cache shared:SSL:10m;

declared either in a block httpor in each block server(i.e. a virtual host), leads to 1) one global cache with the name SSL, larger than 10 MB. Or 2) in one cache 10 MB per server with a total size of all caches = number of servers x 10 MB.

Documents:

shared
cache shared between all workflows. The size of the cache specified in bytes; one megabyte can store about 4000 sessions. Each shared cache must have an arbitrary name. A cache with the same name can be used on multiple virtual servers.

If there is only one cache, then I would like to multiply its size by the number of servers. So, if I have 5 servers (i.e. 5 virtual hosts), I would put ssl_session_cachein a block httpand:

ssl_session_cache shared:SSL:50m;   # 10 * 5 = 50

So the question is: does ssl_session_cache shared:SSL:10m;one 10 MB cache per server or one 10 MB cache for all servers?

If it is on a server, is there no way to configure one global cache for all servers? (If this is not possible, then why not, if anyone knows?) It seems to me that this will lead to more efficient use of memory. (Since there is one server with many clients, it could then use memory that would otherwise be dedicated to another server that may currently have zero clients.)

+4

All Articles