Yardım

1

Odoo 14 website cann't load translation: Mixed Content Blocked

I'm using odoo 14 ce website, I've built simple site with two pages home and contact us, then using translation I've translated the site into arabic language, every thin working fine, but one day later the translation doesn't work, and this message showen in cosole:

    Mixed Content: The page at 'https://xxx/ar/?fw=1' was loaded over HTTPS, but requested     an insecure XMLHttpRequest endpoint         'http://xxx/ar/website/translations/7a29797d51ca1976e69c2e366e5ed9c8c5529307?  mods=&lang=ar_001'.

  This request has been blocked; the content must be served over HTTPS


I'm hosting odoo with contabo vps and plesk obsidian , I've tried to add addional http directives

RewriteEngine On

RewriteCond %{HTTPS} !=on

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Also I've added addional nginx directives:

if ($scheme != "https") {

rewrite ^ https://$host$uri permanent;

}

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

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;

 but nothing changed the same error and translation cann't loaded

1 Yorum
Avatar
Vazgeç
Avatar
Mostafa Barmshory
-

I have the same problem. I had 2 problems:

- I used Cloudflare in proxy mode, and half secure mode

- I did not add host forwarding in Nginx proxy

By updating the config, it is ok now.

4 Yanıtlar
1
Avatar
Bastiaan
Best Answer

I solved this problem in Odoo 14 by setting these headers in my Apache reverse proxy:

RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS}


Avatar
Vazgeç
0
Avatar
Gregor Huyskens
Best Answer
Apparent Solution (Workaround)

This worked for me ONLY SHORTLY  : After some time  failed again!
This must be a bug in Odoo. It's not deployment. 

1) Visit "Settings/Website"  and set the "Standard" language to your new language once. Save.
2) Visit the "Translate"-Function on your old standard language.
3) Reset (if you wish) to your old standard.

4) set the domain name of website

Earlier responses disregarded that the server in this case is never called. The application does not create  a correct protocoll and the browser does not send the request at all.

( on V14.-20210104)


2 Yorumlar
Avatar
Vazgeç
Avatar
Bastiaan
-

Exactly!

Avatar
Ermin Trevisan
-

There is no bug. It only needs a properly configured reverse proxy and then it works flawlessly.

0
Avatar
m
Best Answer

https://stackoverflow.com/questions/51675245/mixed-content-warning-for-insecure-resources-from-odoo


"adding proxy_mode = True into the [options] section of odoo.conf (if you deployed using docker, put odoo.conf into /etc/odoo/odoo.conf, which in their docker-compose.yml example is a shared folder (./config:/etc/odoo)"

solved the issue for me


2 Yorumlar
Avatar
Vazgeç

Thanks for reply, I've tried proxy_mode = True , and other suggestions but not working.

Avatar
Marc Tormo Bochaca
-

And activate programing mode, go to Settings -> Technical -> Parameters
web.base.url https://xxxx.com
web.base.url.freeze True