跳至内容
菜单
此问题已终结
2 回复
780 查看

Hi

my scenario (total 4 separate servers):

- server 1 (10.0.0.1) with nginx

- server 2, 3 and 4 (10.0.0.2, 10.0.0.3 and 10.0.0.4) with Odoo.

Access directly the Odoo servers, everything works.

I am trying to configure the nginx server (10.0.0.1) in reverse proxy to access the other servers (10.0.0.1/2/3) but it does not work. I have tried different configurations, but none of them work. Is this scenario feasible? Thanks

形象
丢弃
最佳答案

Hi Admin

Yes, your scenario is feasible! You can use Nginx on server 1 (10.0.0.1) as a reverse proxy to handle traffic for multiple Odoo instances running on different backend servers (server 2, server 3, and server 4). Below, I’ll provide a step-by-step configuration guide and example Nginx configuration.


What is your nginx conf?

i would presume this sample as example: 

# /etc/nginx/conf.d/odoo_reverse_proxy.conf

# Upstream servers for Odoo
upstream odoo_server_2 {
    server 10.0.0.2:8069;
}

upstream odoo_server_3 {
    server 10.0.0.3:8069;
}

upstream odoo_server_4 {
    server 10.0.0.4:8069;
}

# Reverse proxy for Odoo instance on server 2
server {
    listen 80;
    server_name odoo-server2.example.com;

    location / {
        proxy_pass http://odoo_server_2;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# Reverse proxy for Odoo instance on server 3
server {
    listen 80;
    server_name odoo-server3.example.com;

    location / {
        proxy_pass http://odoo_server_3;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# Reverse proxy for Odoo instance on server 4
server {
    listen 80;
    server_name odoo-server4.example.com;

    location / {
        proxy_pass http://odoo_server_4;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}


Hope it helps you

形象
丢弃
编写者 最佳答案

well,

  • I used dns name and not ip address... but ok
  • not use 443 protocol? i want acces to https://<nginx server>...
  • i used Proxy_set_header X-Forwarded-Host.. no good?

and on odoo server, i must configure nginx reverse proxy (how in a standard install)?


thnk's

形象
丢弃