Odoo Help


1 Answer

Ermin Trevisan

--Ermin Trevisan--
| 7 6 9
Walchwil, 瑞士
--Ermin Trevisan--

Ermin Trevisan
2018/10/26 上午9:54

By default, this is not possible. There are 2 workarounds:

- with your dbfilter setting, "example.com" and "example.example.com" would both point to the database "example"


- you use the module "dbfilter_from_header" instead of the dbfilter parameter and then you specify the database for each hostname separately.

This has nothing to do with the multi-website module.

2018/10/26 上午10:24

That is actually what I need, I tried using it, but somehow it didn't work as expected. I am trying to use also the multi website module. The error I am getting is that the URL is not correct.

So basically it would be that:

domain1. example.com having the database1

example.com having database2 with website1

domain2.example.com with database2 with website2

I want to have one database with two different websites. I am using Odoo 12 and it's behind an nginx reverse proxy, the config for the domain2 website is this:

# Odoo servers

upstream odoo {



upstream odoochat {



server {

listen 80;

server_name domain2.example.com;

include snippets/letsencrypt.conf;

return 301 https://domain2.example.com$request_uri;


server {

listen 80;

server_name example.com;

include snippets/letsencrypt.conf;

return 301 https://example.com$request_uri;


server {

listen 443 ssl http2;

server_name domain2.example.com example.com;

proxy_read_timeout 720s;

proxy_connect_timeout 720s;

proxy_send_timeout 720s;

# Proxy headers

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;

# proxy_set_header X-Odoo-dbfilter ^database2\Z;

# SSL parameters

ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;

ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;

include snippets/ssl.conf;

# log files

access_log /var/log/nginx/odoo.access.log;

error_log /var/log/nginx/odoo.error.log;

# Handle longpoll requests

location /longpolling {

proxy_pass http://odoochat;


# Handle / requests

location / {

proxy_redirect off;

proxy_pass http://odoo;


# Cache static files

location ~* /web/static/ {

proxy_cache_valid 200 90m;

proxy_buffering on;

expires 864000;

proxy_pass http://odoo;


# Gzip

gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;

gzip on;


Another error is I added to the odoo.conf

server_wide_modules = "web, dbfilter_from_header"

but it says it doesn't exists, I have them copied in the addons folder of odoo with the owner odoo:odoo.

I appreciate your help.

twanda AG, Ermin Trevisan
2018/10/27 上午11:24

The module is not ported to Odoo 12.0 yet.

Ask a Question
Keep Informed
1 follower(s)
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.

Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now