I am trying to implement subdomain based DB filtering in Odoo 13.0 CE and following are the configurations I am using.
Databases:
demo
test
/etc/hosts
127.0.0.1 localhost
127.0.0.1 testerp.in
127.0.0.1 test.testerp.in
127.0.0.1 demo.testerp.in
/etc/nginx/sites-enabled/testerp.in.conf
upstream odooserver {
server 127.0.0.1:8069;
}
server {
listen 80;
server_name *.testerp.in testerp.in;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
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 / {
proxy_redirect off;
proxy_pass http://odooserver;
}
location ~* /web/login{
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odooserver;
}
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
odoo.conf
[options]
; This is the password that allows database operations:
admin_passwd =*********
db_host = False
db_port = False
db_user = odoo13
db_password = False
proxy_mode = True
db_filter = ^%d$
addons_path = /opt/odoo13/odoo/addons,/opt/odoo13/odoo-custom-addons
On accessing test.testerp.in or demo.testerp.in it is redirecting to the database selector page(for eg: test.testerp.in/web/database/selector) instead of the login page for the database.
I have also tried running ./odoo-bin --db-filter=^%d$ --proxy-mode and the result is same. Am I missing any other configurations or parameters?