AWS instances to upstream servers
python3
pip3
pip3 install -r requirements.txt
Nginx upstram configuration:
upstream backend {
include /var/lib/nginx/upstream/backend.conf;
}
Upstream File: /var/lib/nginx/upstream/backend.conf
server 0.0.0.1 down;
AWS: Instance tags...
Name | Upstream |
... |
---|---|---|
my_server-1 | backend |
... |
my_server-2 | backend |
... |
my_server-3 | foo |
... |
Create a root
cron:
# Nginx AWS Sync - AWS instances to upstream servers
* * * * * root /path/to/nginx-aws-sync -c /path/to/config.yaml >> /var/log/nginx-aws-sync.log 2>&1