İçereği Atla
Menü
Bu soru işaretlendi
4 Cevaplar
4335 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

list_db = false ?

Avatar
Vazgeç
En İyi Yanıt

Hi Jurn,

Facing exactly the same issue on Odoo 13.

What was the solution to your problem?

Thanks,

Varinder

Avatar
Vazgeç
Üretici En İyi Yanıt

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
Vazgeç

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.

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Mar 15
4772
1
Ağu 24
1094
1
Mar 15
5902
3
Tem 21
8215
5
Ağu 15
55450