I have a cluster of 8 independent web servers, each of them running nginx. They are all hosting the same websites and are being synced with rsync.
Also, each server has 8 different IP addresses attached to it.
My hosted websites are being directed to different IP's according to some business logic.
Is there some way i can sync the configuration file between all server, but change only the IP's on each one?
For example, have a nginx.conf on each server with:
@IP1 = '1.1.1.1';
@IP2 = '2.2.2.2';
include 'sites.conf';
and then sync the sites.conf and let it be something like:
server {
listen @IP1:80;
... //more configurations here
}
Is it possible to do something like that?