Hi Community,
Nginx is new for me. I want to use it as a load balancer for two WordPress websites. I installed Ngnix on a Rhel9 server and created a loadbalancer.conf file in etc/nginx/cond.d/ with the below content. When I type the ngnix IP address in the browser, it redirects me to the host. The web servers' IPs are 192.168.1.106 and 211, and the Nginx IP is 192.168.1.226. When I enter the Ngnix IP in the browser, it redirects me to 106 or 211. I also tested by updating nginx.conf with the below content, but it does the same. Is there any other configuration file that needs to be updated?
upstream myapp1 {
server 192.168.1.106;
server 192.168.1.211;
}
server {
listen 80;
location / {
proxy_pass http://myapp1;
}
}
I appreciate your help!
Nginx is new for me. I want to use it as a load balancer for two WordPress websites. I installed Ngnix on a Rhel9 server and created a loadbalancer.conf file in etc/nginx/cond.d/ with the below content. When I type the ngnix IP address in the browser, it redirects me to the host. The web servers' IPs are 192.168.1.106 and 211, and the Nginx IP is 192.168.1.226. When I enter the Ngnix IP in the browser, it redirects me to 106 or 211. I also tested by updating nginx.conf with the below content, but it does the same. Is there any other configuration file that needs to be updated?
upstream myapp1 {
server 192.168.1.106;
server 192.168.1.211;
}
server {
listen 80;
location / {
proxy_pass http://myapp1;
}
}
I appreciate your help!