Cấu hình loadbalancing nginx cho Odoo
Trên Server Nginx bạn tạo file:
/etc/nginx/sites-enabled/xyz.com.conf
Mã:
|
upstream backend {
server 192.168.1.51:8069;
server 192.168.1.52:8069;
server 192.168.1.53:8069;
server 192.168.1.54:8069;
}
upstream backend-longpolling {
server 192.168.1.51:8072;
server 192.168.1.52:8072;
server 192.168.1.53:8072;
server 192.168.1.54:8072;
}
server {
server_name xyz.com www.xyz.com;
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
server_name xyz.com www.xyz.com;
proxy_connect_timeout 60000;
proxy_send_timeout 60000;
proxy_read_timeout 60000;
send_timeout 60000;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
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_intercept_errors on;
location /longpolling {
proxy_pass http://backend-longpolling;
}
location / {
proxy_pass http://backend;
}
ssl_certificate /etc/nginx/ssl/www_xyz_com.crt;
ssl_certificate_key /etc/nginx/ssl/www_xyz_com.key;
} |
Tham khảo:
https://silentinfotech.com/blog/inst...-ubuntu-16-04/
https://infrastacklabs.wordpress.com...parate-server/