apt-get update && apt-get upgrade -y
apt-get install nginx
Install wordpress di 2 server masing-masing bisa di akses
server 1 : web1.tentangit.local
server 2 : web2.tentangit.local
Konfigurasi di Server parent agar dapat load balance website dengan 1 domain akses.tentangit.local :
Buatkan script seperti berikut :
nano /etc/nginx/conf.d/website.conf
Isi script di bawah :
upstream backends {
server web1.tentangit.local weight=1;
server web2.tentangit.local weight=1;
}
server {
listen 80;
server_name akses.tentangit.local;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
location / {
proxy_pass http://backends;
}
}
0 Komentar