تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
6 الردود
30528 أدوات العرض

Hello guys,

When I try to print some document the odoo tries to generate the PDF using the Wkhtmltopdf. But right after I get this error:

Mixed Content: The page at 'https://' was loaded over HTTPS, but requested an insecure resource 'http://'. This request has been blocked; the content must be served over HTTPS.

I've configure the nginx webserver to use SSL with Let's Encrypt certificate. Everything looks fine, until I get this request over http instead of https. Why this is happening? How should I fix this?

I have already tried to update the web.base.url to https:// instead of http:// and I've also created the paramenter web.base.url.freeze and assigned to True. But that did not fix this issue. I still get that request from http.

Thank you.

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

It may come up due to missing the following, you can check:

in your Nginx probably in /etc/nginx/sites-enabled/some_file , please check X-Forwarded headers are present as below

location / {
proxy_pass http://localhost:8069;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_redirect off;
proxy_request_buffering off;
proxy_connect_timeout  36000s;
proxy_read_timeout  36000s;
proxy_send_timeout  36000s;
send_timeout  36000s;
client_max_body_size 10240m;
}

or in nginx conf, 
proxy_redirect http://yourdomainhere/ https://yourdomainhere/;

or in odoo conf,
proxy_mode = True

Restart nginx, restart odoo serivces and check hopefully it will work now.

You can also check Settings -> Technical -> System Parameters, and make sure your web.base.url contains https:// (some people also add web.base.url.freeze set to True

I hope it would help someone.

الصورة الرمزية
إهمال

This worked perfectly in my case, thank you very much Hamzah

Thank you so much i dont wich of these settings did the trick and at this point i dont care im tired and happy that it worked after trying on my own for 5 hours.

أفضل إجابة

Adding the below line to my nginx config file fixed the issue:

add_header'Content-Security-Policy''upgrade-insecure-requests';
الصورة الرمزية
إهمال

did the job for me, thanks

الكاتب أفضل إجابة

After all it looks like this solution worked:

I have already tried to update the web.base.url to https:// instead of http:// and I've also created the paramenter web.base.url.freeze and assigned to True. 

Thank you.

الصورة الرمزية
إهمال
أفضل إجابة

for anyone facing the same issue, here the fix that Work!

Add this to the odoo nginx conf block inside server block

proxy_redirect http:// https://;

or you can put your domain in, for example in my case: proxy_redirect http://skyerp.net https://skyerp.net;

I tested and it worked perfectly, i tried many other method but only this thing work, you do not need to mess with other setting like web base url, upgrade insecure connection and many other thing that people suggest. 

الصورة الرمزية
إهمال
أفضل إجابة

Gracias Hamza por tu ayuda! En mi caso la solución que funcionó fue agregar en nginx:

location / {
proxy_pass http://localhost:8069;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_redirect off;
proxy_request_buffering off;
proxy_connect_timeout  36000s;
proxy_read_timeout  36000s;
proxy_send_timeout  36000s;
send_timeout  36000s;
client_max_body_size 10240m;
}
الصورة الرمزية
إهمال
أفضل إجابة

Hello there, I am facing this problem as well when switching to non-english languages. 

Is it working by your solution?

الصورة الرمزية
إهمال
الكاتب

Not sure, to be honest.

In the past I believe I was using a non-english language as well. So I believe it should work.

Right now both my Odoo solutions are managed by a service provider.

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
يونيو 25
1753
0
مارس 25
1854
1
مارس 25
1966
2
يوليو 24
4486
1
مايو 24
2916