We created a setup with a load balancer (nginx) and two odoo instances. The load balancer has to distribute the requests equally to both instances to reduce the load.
see Image of simplified configuration
If we use the normal load balancing configuration of nginx and only one user is accessing the web address this leads to an infinite redirection loop between these two instances during the login.
Does anyone know a solution for this loop of redirections?
Currently we set the option ip_hash in nginx. So all requests of the user are forwarded to the same node. But this is not our goal because this setup is used from a office which has only one IP and so all requests are forwarded to the same node and only one node gets the requests.
Used (minified) Nginx Configuration:
upstream balancer {
# ip_hash;
server alpha:8069;
server beta:8069;
}
server {
listen 443;
ssl on;
location / {
proxy_next_upstream http_500 http_502 http_503 http_504 timeout error invalid_header;
proxy_pass http://balancer;
proxy_read_timeout 300;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Url-Scheme $scheme;
proxy_redirect off;
}
}
Can you provide an example of your config file for nginx?