Skip to Content
Menu
This question has been flagged
2 Replies
7730 Views

WIth dbfilter = ^%d$ and reverse proxy: http://<databasename>.domain.com works great.

 <VirtualHost *:80> 
ServerName domain.com ServerAlias *.domain.com // Use this if you want dbfillter on subdomain ErrorLog /var/log/openerp/openerp-error.log CustomLog /var/log/openerp/openerp-access.log combined <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPass / http://localhost:8069/
ProxyPassReverse / http://localhost:8069/
ProxyVia On LogLevel warn </VirtualHost>

What I also want is this:

www.website1.com => database: website1

www.website2.com => database: website2


But how to deal with dbfilter and reverse proxy?

Avatar
Discard
Best Answer

As "dbfilter = ^%d$" is automatically cutting off "www." it works the same way if you define a virtual host for each domain name, such as one virtual host with ServerName www.website1.com and another one with ServerName www.website2.com, means www.website1.com becomes database website1 and www.website2.com becomes database website2.

Avatar
Discard
Best Answer

This is my Apache configuration (sub1 is the name of the database). What you are looking for is the X-ODOO_DBFILTER variable. dbfilter will pick this up. Adapted for your example:

<VirtualHost *:80>
ServerName www.website1.com
ErrorLog /var/log/httpd/www.website1.com-error.log
CustomLog /var/log/httpd/www.website1.com-access.log combined
ProxyRequests Off
Header add X-ODOO_DBFILTER "website1"
RequestHeader add X-ODOO_DBFILTER "website1"
LogLevel warn
<Location /web/database>
Order Deny,Allow
Deny from all
Allow from my.home.ip.address
</Location>
ProxyPass /server-info !
ProxyPass /server-status !
ProxyPass / http://localhost:8069/
ProxyPassReverse / http://localhost:8069/
ProxyVia On
ProxyTimeout 300
</VirtualHost>

And you can repeat this section for every new domain.


Avatar
Discard
Related Posts Replies Views Activity
0
Dec 20
1083
0
Nov 24
37
0
Jun 23
1030
1
Sep 24
3015
1
Aug 24
6027