This question has been flagged
1 Reply
2250 Views

Hello,


I have installed the latest version of dbfilter_from_header in odoo13. The tests are not ok. Can someone advise if it is supported in odoo 13
Below my setup :

2 NGINIX virtual machine 

1st VM :

server {
listen 80;
listen [::]:80;
server_name odoo1.mydomain.com;
if ($http_x_forwarded_proto != 'https') {
rewrite ^ https://$host$request_uri? permanent;
  }
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;

location /longpolling {
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
proxy_pass http://localhost:8072;
 }

location / {
proxy_pass http://localhost:8069;


}
proxy_set_header X-Odoo-dbfilter ^odoo1_.*\Z;
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;

gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}

2nd VM

Same thing as VM1 with domain 

odoo.mydomain.com

proxy_set_header X-Odoo-dbfilter ^odoo_.*\Z;

Expected behaviour :


odoo1.mydomain.com    Target DB odoo1
odoo.mydomain.com    Target DB odoo

BR

Samir


Avatar
Discard

Hi Samar, did you solve this issue? If so, can you share how? I am facing the same problem.

Best Answer

You do not need dbfilter_from_header when only filtering subdomains, the variable %d with dbfilter does exactly what you show in your example. I have dozens of test databases running as subdomains under the same domain and it's working flawlessly. This is my Odoo config:

dbfilter = ^%d$
proxy_mode = True
Avatar
Discard