Add nginx load balancer

pull/21/head
Dan Caseley 2020-11-23 08:48:45 +00:00
parent 919bedaa20
commit dc41f7ccc7
2 changed files with 40 additions and 0 deletions

View File

@ -16,6 +16,18 @@ services:
openfire-clustered-net:
ipv4_address: 172.60.0.11
lb:
image: nginx:stable
ports:
- "55222:55222"
- "57070:57070"
- "57443:57443"
volumes:
- ./nginx/clustered/nginx.conf:/etc/nginx/nginx.conf
networks:
openfire-clustered-net:
ipv4_address: 172.60.0.99
xmpp1:
image: openfire:latest
ports:

View File

@ -0,0 +1,28 @@
# error_log stdout debug;
stream {
upstream xmpp {
server 172.60.0.10:5222;
server 172.60.0.20:5222;
}
server {
listen 55222;
tcp_nodelay on;
proxy_connect_timeout 10s;
proxy_timeout 30s;
proxy_pass xmpp;
}
#upstream bosh {
# server xmpp1:7071;
# server xmpp2:7072;
#}
#server {
# listen 57070;
# proxy_connect_timeout 10s;
# proxy_timeout 30s;
# proxy_pass bosh;
#}
}
events {}