This question has been flagged
4 Replies
3278 Views

We have Odoo 12 (enterprise) on Ubuntu 18 running.


I want to force a database selection when a request comes from a certain domain (the webshop domain) 


So https://webshop.mydomain.com should only use the production "myproductiondb"


In /etc/odoo/odoo.conf I have set this:

server_wide_modules = base,web,dbfilter_from_header

proxy_mode = True


In Apache:

     ProxyRequests Off

     RequestHeader set X-Odoo-dbfilter "myproductiondb"


     #Redirect to ODOO

     ProxyPreserveHost On

     ProxyPass / http://localhost:8069/ retry=0

     ProxyPassReverse / http://localhost:8069/



However I still get redirected to webshop.mydomain.com/web/database/selector

If I add this in /etc/odoo/odoo.conf

dbfilter = myproductiondb

It works. But now it is always doing this, while I only want to force this on the webshop. So why is the RequestHeader functionality not working. 

Hope someone can help me

Thanks
Avatar
Discard
Best Answer

Hi Jurn:

There may be a simpler way to do this by using %d in the dbfilter setting in odoo.conf

Take a look at the 2nd example provided here:

https://www.odoo.com/documentation/12.0/setup/deploy.html#configuration-samples

Avatar
Discard
Best Answer

list_db = false ?

Avatar
Discard
Best Answer

Hi Jurn,

Facing exactly the same issue on Odoo 13.

What was the solution to your problem?

Thanks,

Varinder

Avatar
Discard
Author Best Answer

Hi Paresh, 

Thanks! However does this work if the database name is "myproductiondb" and the domain "webshop.mydomain.com" (so no relation in name)?
Or does this automatically work when the system parameter web.url is set to  in the database 
myproductiondb?


Thanks

Avatar
Discard

No. The name of the database should match the domain. You can duplicate and rename the database if you are still in the development phase. If you are already in production, you will need to assess the impact of changing the name of the database. For example, you may have backup scripts that have the database name hard coded in them.