Skip to Content
Menu
This question has been flagged
1 Reply
7197 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

Avatar
Discard
Best Answer

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;
}
}

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 15
10097
1
Apr 15
7089
1
Mar 15
2449
2
Mar 15
15524
1
Jan 24
11862