dimanche 11 août 2019

How to configure multi website in odoo v12?

How to domain redirect to websites in odoo12 multi website and how to differentiate both URL.

IP and port is same here.

Eg:

xxxxxx:8012 -> website-1 -> domain1

xxxxxx:8012 -> website-2 -> domain2

I have setup nginx for website-1 which is working fine. but no idea how to configure website-2.

upstream domain1{
    server xxxxxxxxxxx:8012;
}
server{
    listen      80;
    server_name domain1;
    access_log  /var/log/nginx/odoo.com.access.log;
    error_log   /var/log/nginx/odoo.com.error.log;
    proxy_buffers 16 64k;
    proxy_buffer_size 128k;
    location / {
        proxy_pass  http://domain1;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;
        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto https;
     }
     location ~* /web/static/ {
        proxy_cache_valid 200 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://domain1;
}}

Domain in redirected as per expectation.




Aucun commentaire:

Enregistrer un commentaire