Skip to Content
Menu
This question has been flagged

Hi All!

I have configure Odoo 14 and have created a single database.
I have created 2 domains and pointed to the server and have created 2 websites in the odoo database and gave the domain names in the configuration.

I have also created the nginx config for both the domains and pointed it to localhost:8069 as usual and added the proxy_mode in config file.

Now after all these setup when I try to hit the domains I am always getting redirect to the First site for both the domains.

Is this multi website feature not yet fully developed or am I missing any configuration in this ?

I didn't find any official documentation regarding this.

It would be great if someone can help me out.

Thanks!

Avatar
Discard
Best Answer

Hello,

Multi website in odoo 14 is working after configuration of below steps:

1. You must configure website domains for all websites, in my example I have website1 and website 2, I gave test1.com and test2.com to website respectively.



2. in directory /etc create file with name "hosts" and paste below content in that file



127.0.0.1 localhost test1.com test2.com
127.0.1.1 erp

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


3. setting for nginx, you must have site-available and site-enable with your domain:

in my example I have test.com file created on /etc/nginx/sites-available/, Please create file and paste below content in that file.



upstream odootest {
server 127.0.0.1:8069;
}
server {
listen 80;
server_name test1.com test2.com;

location / {
proxy_pass_header Server;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_pass http://odootest;
}
}

4. Relead nginx and try to browse with test1.com or test2.com.

Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
    

Avatar
Discard

Was helpful

Best Answer

hi make sure your reverse proxy properly configure, in multi website case odoo will get host from the request and try to match it with configure domain 
so the host proxy header must be forwarded to odoo 

  
  proxy_set_header X-Forwarded-Host $host; 

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr;


Avatar
Discard
Related Posts Replies Views Activity
1
Jan 21
14853
3
Apr 25
1684
1
Apr 25
917
1
Dec 24
1225
1
Oct 24
1108