Odoo Help

0

Nginx with 2 Odoo Instances v7 and v8

By
Paulo Matos‏
on 7/19/15, 1:14 PM 1,667 views


Dear all,

I have 2 instances of Odoo running on the same server. One for v7 and other for v8.

I setup 2 subdomains for each instance. ODOOV7 for v7 (port 8069) instance and ODOOV8 for v8 (port: 8089) instance.

I am new to nginx and trying to setup nginx for reverse proxy both subdomains (one foreach instance).

The script I use for v8 instance (just for http proxy since not using at this moment https) - UPPER case replaced by domain name



#worker_processes 1; #events { # worker_connections 1024; #} server {      listen 80;     server_name ODOOV8.DOMAIN.COM;      location /socket.io {         proxy_pass http://SERVER_IP:8089;          proxy_http_version 1.1;          proxy_set_header Upgrade $http_upgrade;          proxy_set_header Connection "upgrade";          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 https;          proxy_redirect off;      }     location / {          proxy_pass http://SERVER_IP:8089;      } }

Can anyone help me change this code in order to reverse proxy both instances?

Thank you very much

Paulo

1
Axel Mendoza
On 7/19/15, 5:25 PM

You need to do something like this
 

    upstream odoov7 {
        server SERVER_IP:8069 weight=1 fail_timeout=300s;
    }
    upstream odoov8 {     server SERVER_IP:8089 weight=1 fail_timeout=300s;     }

server { listen 80; server_name ODOOV7.DOMAIN.COM; location /socket.io { proxy_pass http://odoov7$request_uri; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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 https; proxy_redirect off; } location / { proxy_pass http://odoov7$request_uri; } } server {
listen 80;
server_name ODOOV8.DOMAIN.COM;
location /socket.io {
proxy_pass http://odoov8$request_uri;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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 https;
proxy_redirect off;
}
location / {
proxy_pass http://odoov8$request_uri;
}
}

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 7/19/15, 1:14 PM
Seen: 1667 times
Last updated: 7/19/15, 5:26 PM