This question has been flagged
4 Replies
13246 Views

Odoo 13

I loaded german translations. Website menu items are not loaded for inner languages than default. 

After "Inspect" in "Chrome" I got following error:

Mixed Content: The page at 'https://MY_DOMAIN/de/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://MY_DOMAIN/de/website/translations/40a3e17d54c83f1fc09736b160fc4e6c395f3fba?mods=&lang='. This request has been blocked; the content must be served over HTTPS.

Where make sending translations over httpS?

I changed Technical --> Parameters --> System Parameters web.base.url to https:// and created web.base.url.freeze to True. 

Moreover in Odoo.conf I set proxy_mode = True
I added proxy_set_header X-Forwarded-Host $host; to MY_DOMAIN configuration nginx file

Avatar
Discard
Best Answer

For me it worked to add "add_header Content-Security-Policy upgrade-insecure-requests;" into nginx configuration. Still testing if everything works. But it's for odoo 12.

Avatar
Discard

Thank you soc much

Best Answer

Hi,

1. Technical --> Parameters --> System Parameters web.base.url to https:// and created web.base.url.freeze to True.

2. in Odoo.conf set proxy_mode = True

3. Set up nginx conf --> add correct headers

server {

     listen [::]:80;

     listen 80;

     ssl off;

     server_name odoo.implemento.sk;

     return 301 https://$host$request_uri;

     rewrite ^(.*) https://$host$1 permanent;

}


server {

    listen [::]:443 ssl http2;

    listen 443 ssl http2;

    server_name odoo.implemento.sk;


    # RSA certificate

    ssl on;

    ssl_certificate /etc/letsencrypt/live/odoo.implemento.sk/fullchain.pem; # managed by Certbot

    ssl_certificate_key /etc/letsencrypt/live/odoo.implemento.sk/privkey.pem; # managed by Certbot

    

    proxy_read_timeout 600s;

    client_max_body_size 512M;

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

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


    location /longpolling {

        proxy_pass http://127.0.0.1:8072;

    }


    location / {

        proxy_pass http://127.0.0.1:8069;

        proxy_cookie_path / "/; secure; HttpOnly;";

        add_header Strict-Transport-Security "max-age=315360000000";

        add_header X-Frame-Options "SAMEORIGIN";

        

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;

        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_http_version 1.1;

        proxy_request_buffering off;


        satisfy any;

        allow 127.0.0.1;

        deny all;


        auth_basic "Protected area";

        auth_basic_user_file /etc/apache2/.htpasswd;


        # common gzip

        gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;

        gzip on;

    }

}

Avatar
Discard
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
Discard
Best Answer

Hi Kolda, were you able to resolve this problem?

The translations file is only being loaded over http:// for non-logged-in users. After log in, it is correctly loaded over https:// . Running Odoo 13 from official Docker image.

Avatar
Discard