Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4 Răspunsuri
1091 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

Please refer to the link:

1. https://www.odoo.com/documentation/18.0/administration/on_premise/deploy.html

Official Odoo documentation on proxy/production deployment.


Hope it helps.

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

Hey, read this document: How to Configure Odoo with Nginx as a Reverse Proxy

Imagine profil
Abandonează