This question has been flagged
28 Replies
11424 Views

My PDF shows up on front of the Public Slides, and in the Menu for the public slides.  It doesn't show up when I'm on the page for the actual PDF though.

It's fine here: https://nixtamalized.com/slides

and it's fine here: https://nixtamalized.com/slides/public-channel-1

but not here: https://nixtamalized.com/slides/slide/knivesandchives-llc-receipt-1

How do I fix this?


Thank you!

Avatar
Discard
Best Answer

You can just add the following line in the <head> section of your website:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"/>
This fixed it for me.
Avatar
Discard

thank you try many thing but this solution work for me just edit

web.layout

indeed many thanks!

Best Answer

 https://www.odoo.com/de_DE/groups/community-59/community-13327850?mode=thread 

It looks like you have the same problem I do (see https://www.odoo.com/de_DE/forum/hilfe-1/question/8-0-website-slides-uploading-a-presentation-keeps-loading-forever-93332).

If you look into your console in the browser's development tools you see the following:

Blocked loading mixed active content "http://www.twanda.ch/slides/embed/6?page=1"[Learn More]

This is because the PDF is loaded from a http link instead of an https link. So far I have no idea how to correct this. My system parameter web.base.url is properly set to https.


Solution:

In the configuration of your virtual host on your proxy server the following parameter must be set:

(Apache version)

RequestHeader set "X-Forwarded-Proto" "https" 

See examples here:

https://www.odoo.com/de_DE/groups/community-59/community-13327850?mode=thread 

Avatar
Discard
Author

Thank you for the response! I will look at my browsers dev console.

Author

Okay. Chrome says this: knivesandchives-llc-receipt-1:414 Mixed Content: The page at 'https://nixtamalized.com/slides/slide/knivesandchives-llc-receipt-1' was loaded over HTTPS, but requested an insecure resource 'http://nixtamalized.com/slides/embed/1?page=1'. This request has been blocked; the content must be served over HTTPS. Firefox says this: Blocked loading mixed active content "http://nixtamalized.com/slides/embed/1?page=1"[Learn More]

Author

Ermin, Where do I find the system parameter website.url ? I bet I haven't set it to https. Is it under "Website Admin" -> "Configuration" -> "Website name" ? I have this set to "nixtamalized.com", and neither http or https

Author

I found a setting under "General Settings" with "Website" and it was configured "http://nixtamalized.com" so i changed that to https

But, in my case at least, it does not help...(I have deleted the PDF and uploaded it anew).

I get a new error: UnexpectedResponseException: Unexpected server response (301) while retrieving PDF "https://www.twanda.ch/slides/slide/7/pdf_content"

Author

that didn't change anything. i uploaded a new pdf and that didn't work. PNG's appear to be working though! I can make my PDFs into PNGs for now.

Author

Under "Website Admin" -> "Slides - Channels" -> "Public Channel" -> each message that logs what i've done in this Slide Channel has http and not https for the item.

I'm still trying to find a way, but I suppose it is a bug, in version 9.0 it works flawlessly. It is also not possible to create a slide in the backend, this results in a 500 server error :-(

Author

I'm on version 9 :(

Author

Where exactly is the system parameter website.url ?

Well, you are right, in my case it only works for 9.0 because it is a test server, which is not yet SSL secured. You can find the parameter web.base.url under Settings/Technical/Parameters/System Parameters. You need to activate the developer mode in order to access these settings.

Maybe this could point to a solution: https://github.com/mozilla/pdf.js/issues/6446

Author

Ermin, You are the best!! That fixed it right up. Changing web.base.url to be https!!

Author

My nginx configuration already has that setting in it -- here it reads in nginx: location / { proxy_pass http://openerp; # force timeouts if the backend dies proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; # set headers 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; }

Your site still tries to load from http:// instead of https://. So I assume that something in your proxy conf does not work properly. Try to check with other nginx configurations on the internet. I have Apache and after the change in my virtual hosts configuration, a restart of Apache and a reload of the website it worked immediately and all contents are now loading from https://.

I don't know how it could make a difference, if any, but I have dbfilter activated in my odoo-server.conf and installed the module https://www.odoo.com/apps/modules/8.0/dbfilter_from_header/

Andy, just a stupid question (but I had a conversation with somebody, who had this problem): have you set "proxy_mode = True" in your Odoo config file?

Best Answer

Solution for NGINX:

    location / {      
    proxy_pass http://moneygrid-net;       
    # force timeouts if the backend dies     
     proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
     proxy_redirect off;
     # set headers
     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;

}

Avatar
Discard
Best Answer

I went to parameter website.url under "Website Admin" -> "Configuration" -> "Website name" ? and updated to https.

Fixed the issue for Firefox, but still does not load pdfs using Chrome.

Please help. Thanks

Avatar
Discard
Author Best Answer

well, i spoke to soon.. it is acting differently.  it shows the PDF on the item page now.  It also still throws a warning about Mixed Content and how it still wants to show an http bound file.

I also have a display widget showing that it is "loading".. i'm assuming indefinetly because it is still "loading" after some time.

When I click on the "full screen" button, it only shows me what is in the item preview display, not the whole document.


hmm i didn't mean to post like this.

Avatar
Discard
Author

Chrome's error message is now: Mixed Content: The page at 'https://nixtamalized.com/slides/embed/6?page=1' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://nixtamalized.com/slides/slide/ein-number-6/pdf_content'. This request has been blocked; the content must be served over HTTPS. 6:1 Uncaught (in promise) UnexpectedResponseException {name: "UnexpectedResponseException", message: "Unexpected server response (0) while retrieving PD…s://nixtamalized.com/slides/slide/6/pdf_content".", status: 0}

Andy, see my last comment, it seems to be a CORS (Cross Origin Ressource Sharing) issue. Besides the link I have already posted in this comment, this one should be helpful also: https://awesometoast.com/cors/ But I was not successful so far...

I GOT THE SOLUTION!!!! Forget about CORS. You need to set the RequestHeader set "X-Forwarded-Proto" "https" in your virtual host conf in your proxy server, see the following sample for Apache: https://www.odoo.com/de_DE/groups/community-59/community-13327850?mode=thread

Best Answer

I am experiencing nearly the same problem but on v11 CE.  Posted problem separately to this forum but no one is providing any suggestions.  https://www.odoo.com/forum/help-1/question/slides-module-not-showing-slides-cors-errors-126741 

Avatar
Discard
Best Answer

I GOT THE SOLUTION

Goto the Settings -> Activate Developer Mode -> Technical Menu -> Parameters -> System Parameters ->   "web.base.url" Field Value Changed "http://" to "https://"

Avatar
Discard