Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

10
Zarafa multiserver reverse proxy Steve Hardy

description

 

Transcript of Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

Page 1: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

Zarafa multiserver reverse proxySteve Hardy

Page 2: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

• General idea– Parts of the system

• HTTP(s) proxy• Zarafa server

– Some details• Session IP locking• Internal vs external connections

• Network layouts– SSL offload

– Loadbalancer

• Configuration– Configuring

– Testing (stats)

Cluster node proxy

Page 3: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

• Single exposed ‘host’ to clients for cloud solutions• Host may be:

– Single hostname, single IP

– Single hostname, round-robin IP

• Advantages:– Easier firewalling

– Use off-the-shelf proxy / loadbalance hardware

Goal

Page 4: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

Old situation

Page 5: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

New situation

Page 6: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

Why it doesn’t work

Client

What a nice day, let’s connect to my fav server revproxy.zarafa.com

“Hi, please give me john’s store”

Dagnabbit, ok, I’ll connect to node2.internal.local and retry

CONNECTION REFUSED

Server (Node 1)

“Uh, sorry, I don’t have that, you have to ask Node2, he’s at http://node2.internal.local:237/zarafa”

Server (Node 2)

*snore*

Page 7: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

Why it does work with reverse proxy support

Client

What a nice day, let’s connect to my fav server revproxy.zarafa.com

“Hi, please give me john’s store”

Dagnabbit, ok, I’ll connect to revproxy.zarafa.com/node2 and retry

Server (Node 1)

“Uh, sorry, I don’t have that, you have to ask Node2, he’s at http://node2.internal.local, but I see you connected through a proxy, in that case you should use http://revproxy.zarafa.com/node2”

Server (Node 2)

Here’s john’s store for you. Have fun.

Page 8: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

• Node1– ipHost: node1.local

– zarafaPort: 236

– zarafaHttpsPort: 237

– zarafaProxy: http://proxy.domain.com/node1

• Node2– ipHost: node2.local

– zarafaPort: 236

– zarafaHttpsPort: 237

– zarafaProxy: http://proxy.domain.com/node2

Configuration of nodes

Page 9: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

• In some cases using the proxy is unnecessary– Local connects between nodes

– Not very frequent

– One case:• Spooler uses ‘copy to delegated sent-items after send’ feature• After sending message, spooler must copy item to sent items folder, which is

possible on other host• Spooler connects to other host• Proxy not needed

• Strategy is:– Only return node’s proxy address if the originating request was itself

proxied

– Detected by looking at header, uses setting ‘proxy_header’

To revproxy or not to revproxy

Page 10: Zarafa SummerCamp 2012 - Zarafa Cluster using a reverse proxy

• X-Forwarded-For header– Used as originating IP address

– Used for session <-> IP locking

– Used in zarafa-stats (including –top)

Proxy headers