Open hatzisn opened 1 year ago
Hello hatzisn,
I have created an article about how to load balance your web servers (WordPress) using Nginx Proxy Manager and Cloudflare. You may have a look at it. However, it is just a temporary workaround. Hopefully, the upstream module will be included in the Nginx Proxy Manager UI in v3.
You have to modify your Nginx Proxy Manager built-in configuration files in order to make the upstream module function properly. Moreover, you will need to create some custom configuration files. Try my method on a flash-installed Linux VM/VPS first, as it may mess up your current settings.
I am not familiar with proxy headers. Feel free to correct me if I forget to include some necessary proxy headers.
@hatzisn I did a loadbalancer setup that works with npm as the follows:
Requirements:
Setup your nginx server (can simply run it as a docker container)
Example:
version: '3.8'
services:
lb:
image: nginx:latest
container_name: web_nginx_bootstrap_loadbalancer-lab-lb
restart: unless-stopped
volumes:
- /volume1/docker/containers/Bootstrap/loadbalancer-lab/lb/config/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "1010:80"
Make sure to edit your nginx.conf file in the mounted file # nginx.conf
http {
upstream all {
server 10.0.12.201:8081;
server 10.0.12.201:8082;
}
server {
listen 80;
location / {
proxy_pass http://all/;
}
}
}
events { }
Finally, configure your NPM with a host to point to that LB docker container nginx with the port # 1010 for example.
Would love this to be a built in feature as i believe it's all just a wrapper over the nginx upstream config anyway. Would be super useful
Would really appreciate to see this feature inbuilt in Nginx Proxy Manager. Load balancing will help achieve high availability of services, in case of hardware failure/security compromised etc (if services are hosted on a single backend host instance.) This feature will make it more attractive to enterprise users.
Agreed, having some simple load balancing option would be a good to have feature for sure
I agree: a Load Balance config option (easy like a Apple GUI) would be great. I would be wonderful if it allow not only localaddressess but world wide addresses.
+1
Hello, great work and thanks. Is it possible to use the tutorial as seen in the following video for load balancing?
https://www.youtube.com/watch?v=QE26N9cHE2M
I tried setting the specific .conf file in /data/nginx/proxy_hosts to read/write/execute for everyone and then I "sudo nano" it adding what is mentioned in this video. It worked after restarting NginxProxyManager container but I get redirected to the first only selection. Can you guess on what might have gone wrong and give a piece of advice. A good thing to do is integrate this if you please...
Thanks a lot, again.