Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1449 มุมมอง

Dear All,

How can I configure NGINX to host two Odoo instances on the same server using location directives in NGINX?

--

Instance 1:

  • Internal Address: 127.0.0.1:8069
  • Expected URL: 127.0.0.1/odoo1/


Instance 2:

  • Internal Address: 127.0.0.1:8070
  • Expected URL: 127.0.0.1/odoo2/

อวตาร
ละทิ้ง
ผู้เขียน

Dear All,
Please help me.

คำตอบที่ดีที่สุด

Hi,

1. Each Odoo instance must listen on a different port. Locate the configuration files for each Odoo instance (typically located at /etc/odoo/odoo.conf or /etc/odoo.conf) and set the xmlrpc_port option to unique ports for each instance.

[options]

; Set the port for Odoo version 1

xmlrpc_port = 8069

; Set the port for Odoo version 2

xmlrpc_port = 8070

2. The example of nginx configuration is:

server {

    listen 443 ssl;

    server_name custom-domain.com;

    ssl_certificate /path/to/fullchain.pem;

    ssl_certificate_key /path/to/privkey.pem;

    location /odoo1 {

        proxy_pass http://127.0.0.1:8069;

        proxy_redirect off;

        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;

    }

    location /odoo2 {

        proxy_pass http://127.0.0.1:8070;

        proxy_redirect off;

        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;

    }

}

You can refer the following log for more details:

https://www.cybrosys.com/blog/how-to-setup-two-versions-of-odoo-in-the-same-server-with-one-domain-and-ssl


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

Dear Cybrosys Team,
Thank you for your reply, I have got the 404 Error after calling my odoo server - 127.0.0.1/odoo1/ after trying your method, Could you please demonstrate with Youtube Video for other members?

คำตอบที่ดีที่สุด

How about your second instance odoo2? Is this working with the config?

อวตาร
ละทิ้ง
ผู้เขียน

They both are working when they are called with their specific port number but not with NGINX Config.

Hi Gladiator, can you show your actual nginx configuration? Do you have a server_name directive as shown in the example of Cybrosys? If so, this would not match your setup where it seems you want to work with the IP instead ...

ผู้เขียน

The configuration of my NGINX is same as Cybrosys but the server return as 404 at log Mr. Michael.

Try to change the following:
+ change "listen 443 ssl;" to "listen 80;"
+ remove server_name
+ remove ssl_xyz

The nginx configuration in the first answer doesn't fully match your requirements

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ค. 24
718
Reverse Proxy Converts URL to Garbage แก้ไขแล้ว
1
ก.ค. 23
3513
1
มิ.ย. 25
277
2
พ.ค. 25
788
1
พ.ค. 25
585