Community mailing list archives

community@mail.odoo.com

Re: Create virtual hosts for odoo website on nginx (server blocks)

by
Skillteam, Houssine BAKKALI
- 10/17/2015 16:45:36
yep!

2015-10-17 22:02 GMT+02:00 Yassine Teimi <yteimi01@gmail.com>:

Ah okay,

So my virtual hosts (server blocks), will be like this :

Server {

Server_name www.domain1.com
proxy_set_header X-OpenERP-dbfilter [database_name_2]
}

Server {

Server_name www.domain2.com
proxy_set_header X-OpenERP-dbfilter [database_name_2]
}

Correct me if I'm wrong.

Thanks a lot Houssine.

                        

Le 17 oct. 2015 20:52, "Houssine BAKKALI" <houssine.bakkali@gmail.com> a écrit :
you just do the same than for subdomains... you define one virtual server per domain or subdomain and you sert the "proxy_set_header X-OpenERP-dbfilter [your filter];" directive in each virtual server definition... each one mapping to the desired database...

2015-10-17 21:47 GMT+02:00 Yassine Teimi <yteimi01@gmail.com>:

Yes, but I have multiple domain name, i understand that if i want to do a mapping into a single database,  for a single domain name, but how to do the same for the other domain names ?

The goal is how to redirect every domain name to its database with this module.

Thanks houssine for your help. I hope I made myself clear.

Le 17 oct. 2015 19:52, "Houssine BAKKALI" <houssine.bakkali@gmail.com> a écrit :

With the module you bypass the database filter so no needs to set it in the odoo config file...

Le 17 oct. 2015 18:57, "Yassine Teimi" <yteimi01@gmail.com> a écrit :

Okay, and if I want to create multiple database filters, each filter is related to a domain name. (because I'm in multi domain environnement), how to handle this on nginx?

As I Understood, I Should create a proxy_set_header for every server block. How son I technically do this ?

Le 17 oct. 2015 17:37, "Houssine BAKKALI" <houssine.bakkali@gmail.com> a écrit :

This module is independent from the domain or the sub domain. You choose in you filter to which database you virtual server will be redirected to

Le 17 oct. 2015 18:18, "Yassine Teimi" <yteimi01@gmail.com> a écrit :
Thanks a lot Houssine, 

Is the module able to handle mapping with domain names too ? for example, I want to map my domain name to a database using this module, is that possible ?

2015-10-17 14:08 GMT+01:00 Houssine BAKKALI <houssine.bakkali@gmail.com>:
the subdomain name should be equal to your database name... except if you use www as subdomain

the OCA module is dbfilter_from_header

with this module you will need to add this line
proxy_set_header X-OpenERP-dbfilter [your filter]; where you replace [your filter] by the database name that you want to map to this sub.domain

2015-10-17 14:47 GMT+02:00 Yassine Teimi <yteimi01@gmail.com>:

Thanks houssine,

So first i've to create my subdomain, and configure it this way on the server block, then use a regex expression on dbfilter to map my subdomain into a database with the same subdomain name, at least a database name containing the subdomain name.

I remember we had a previous discussion about this, and we also talked about an odoo module that allows you to map a subdomain to odoo database, without the condition : subdomaine name=odoo database name. Can you tell me more about this ?

Le 17 oct. 2015 13:33, "Houssine BAKKALI" <houssine.bakkali@gmail.com> a écrit :
nope you replace xxxx or yyyy by the subdomain of your choice the one you defined...

www.example.com or myodoo.example.com

keep in mind that subdomain name can be mapped to database name using dbfilter in your odoo config file...

2015-10-16 23:03 GMT+02:00 Yassine Teimi <yteimi01@gmail.com>:
Ah okay Thanks.

So you did "xxxx.example.com" to listen to subdomains too ? 

Why did you do "yyyy.example.com" too ?



2015-10-16 21:46 GMT+01:00 Bassirou Ndaw <b.ndaw@ergobit.org>:

In Odoo, you do not have a path where website files reside but a running odoo server which is listening on a given port (default port 8069). This server and the port are given in the 2nd line of the config below. The redirection to this server take place in the last line of the config

 

 

 

From: Yassine Teimi [mailto:yteimi01@gmail.com]
Sent: Freitag, 16. Oktober 2015 21:58
To: Community <community@mail.odoo.com>
Subject: Re: Create virtual hosts for odoo website on nginx (server blocks)

 

Thanks for your anwser, 

 

Usually with other CMS we use a root parameter, where the website files resides, with Odoo how is it handled ? I can't see any routing parameter in your files ? 

 

Regards.

 

2015-10-16 20:33 GMT+01:00 Bassirou Ndaw <b.ndaw@ergobit.org>:

Hi,

 

here is an example which is currently running as reverse proxy for odoo

 

--------------------------------------------------------------------------------------------

upstream odoo-server {

    server 127.0.0.1:8069 weight=1 fail_timeout=0;

}

 

upstream odoo-server-im {

    server 127.0.0.1:8326 weight=1 fail_timeout=0;

}

 

## http redirects to https ##

server {

             listen 80;

    server_name  

                           xxxx.ergobit.org

                           yyyy.ergobit.org ;

             # Strict Transport Security

             add_header Strict-Transport-Security max-age=2592000;

             rewrite ^/.*$ https://$host$request_uri? permanent;

    #return 301 https://$host$request_uri;

}

 

server {

    listen 443;

    server_name  

                           xxxx.ergobit.org

                           yyyy.ergobit.org ;

 

    # Specifies the maximum accepted body size of a client request,

    #   as indicated by the request header Content-Length.

    client_max_body_size 200m;

 

    # ssl certificate files

    ssl on;

    ssl_certificate        /etc/ssl/certs/abcd.xyz.crt;

    ssl_certificate_key    /etc/ssl/private/acd.xzy.key;

   

    # ssl log files

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

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

 

    # add ssl specific settings

    keepalive_timeout    90;

 

    # increase proxy buffer to handle some OpenERP web requests

    proxy_buffers 16 64k;

    proxy_buffer_size 128k;

 

             #general proxy settings

    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

 

    # set headers

    proxy_set_header Host $host;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

 

    # Let the OpenERP web service know that we’re using HTTPS, otherwise

    # it will generate URL using http:// and not https://

    proxy_set_header X-Forwarded-Proto https;

 

    # by default, do not forward anything

    proxy_redirect off;

    proxy_buffering off;

 

    location / {

        proxy_pass    http://odoo-server;

    }

 

    location /longpolling {

        proxy_pass    http://odoo-server-im;

    }

 

    # cache some static data in memory for 90mins.

    #     under heavy load this should relieve stress on the odoo web interface a bit.

    location ~* /web/static/ {

        proxy_cache_valid 200 90m;

        proxy_buffering    on;

        expires 864000;

        proxy_pass http://odoo-server;

    }

 

}

--------------------------------------------------------------------------------------------

 

Best regards

Bassirou Ndaw

 

 

From: Yassine Teimi [mailto:yteimi01@gmail.com]
Sent: Freitag, 16. Oktober 2015 20:32
To: Community <community@mail.odoo.com>
Subject: Re: Create virtual hosts for odoo website on nginx (server blocks)

 

I'm using nginx as a reverse proxy, does it impact the virtual host (server block) creation ? 

 

2015-10-16 19:03 GMT+01:00 Yassine Teimi <yteimi01@gmail.com>:

Dears,

I've created a server blocks (on nginx) or virtual host (on apache), i want someone to share his virtual host created under nginx, so as to compare with mine, then i'll feed you guys more informations about my concern.

Thanks for your answers.



 

--

 

Cordialement

 

Yassine TEIMI

 

Consultant & Odoo Project Manager

TEL : +212 6-27 33 30 78

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



 

--

 

Cordialement

 

Yassine TEIMI

 

Consultant & Odoo Project Manager

TEL : +212 6-27 33 30 78

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--

Cordialement

Yassine TEIMI

Consultant & Odoo Project Manager
TEL : +212 6-27 33 30 78

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--

Cordialement

Yassine TEIMI

Consultant & Odoo Project Manager
TEL : +212 6-27 33 30 78

_______________________________________________

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe