Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to edit Odoo 17 website. Mixed Content Error #3441

Open
1 of 2 tasks
BayBreezy opened this issue Sep 14, 2024 · 11 comments
Open
1 of 2 tasks

[Bug]: Unable to edit Odoo 17 website. Mixed Content Error #3441

BayBreezy opened this issue Sep 14, 2024 · 11 comments

Comments

@BayBreezy
Copy link

Description

I created an Odoo 17 website with the 1-click service.
I was able to add the Recruitment module.
When I tried editing the Website, the editor would not open, I kept getting this error in the web console

Mixed Content: The page at 'https://odoo.coolify.behonbaker.com/web#action=247&cids=1&menu_id=176' was loaded over HTTPS, but requested an insecure frame 'http://odoo.coolify.behonbaker.com/'. This request has been blocked; the content must be served over HTTPS.

After some amount of digging, i stumbled on this post: Mixed Content Error where someone stated that adding a few headers to the Nginx config would fix the problem.

I am not sure of how to do this in the UI of Coolify. This is what I see for this service:
image

Can you help me or point me to the docs that say how we can add the different heders to the proxy file?

Minimal Reproduction (if possible, example repository)

  • Create an Odoo 17 app with the 1-click service from the UI
  • Start the website and visit the live URL given by coolify.
  • Go to the website editor in Odoo

Exception or Error

Mixed Content: The page at 'https://odoo.coolify.behonbaker.com/web#action=247&cids=1&menu_id=176' was loaded over HTTPS, but requested an insecure frame 'http://odoo.coolify.behonbaker.com/'. This request has been blocked; the content must be served over HTTPS.

Version

4.0.0-beta.335

Cloud?

  • Yes
  • No
@djsisson
Copy link
Contributor

im not sure which part is broken for you

image

image

@BayBreezy
Copy link
Author

The website editor. Try editing the website. I did get the recruitment module to work no problem

@djsisson
Copy link
Contributor

@BayBreezy this took way to long to fix, none of the suggestions worked

image

add a transform rule in cloudflare

modify response headers

match your odoo domain
then add dynamic Location and set value to
concat("https://", substring(http.response.headers["location"][0], 7))

please note i also have amended some traefik labels, but im not sure they are even necessary at this point

@BayBreezy
Copy link
Author

Thanks for the hard work @djsisson ,
Sadly, I am not using cloudflare. I just have the app started from coolify.
Can you share the labels added to the compose file?
Thanks again

@djsisson
Copy link
Contributor

@BayBreezy

- traefik.http.routers.odoo.entryPoints=http
- traefik.http.middlewares.csp-header.headers.customResponseHeaders.Content-Security-Policy=upgrade-insecure-requests
- traefik.http.routers.odoo.middlewares=gzip,csp-header
- 'traefik.http.routers.odoo.rule=Host(`odoo.domain.com`) && PathPrefix(`/`)'
- traefik.http.routers.odoo.priority=100

this is for http, you would need to modify for https

also i added this volume mount

-
        type: bind
        source: ./odoo.conf
        target: /etc/odoo/odoo.conf
        contents: |
          [options]
            addons_path = /mnt/extra-addons
            data_dir = /var/lib/odoo
            proxy_mode = True

i also modified the web.base.url and web.base.url.freeze in Settings -> Technical -> System Parameters in dev mode

@djsisson
Copy link
Contributor

note the volume mount will remove the admin password if u have one set up

@BayBreezy
Copy link
Author

Ok. Thank you. I will give this a shot when I am around the computer again. I will let you know if it helped

@BayBreezy
Copy link
Author

@djsisson well that didn't work :(

@djsisson
Copy link
Contributor

@BayBreezy the other option is to install a plugin for traefik that modifies headers, and the nyou can jsut modify the Location header using a regexp, similar to what i did in cloudflare

@BayBreezy
Copy link
Author

@djsisson , I will have to do that... after learning how ytaefik works lolol.
I only know about traefik through coolify. Been using nginx all my life.
But If i get it to work, I will share my findings. Thanks for the help. I appreciate it

@djsisson
Copy link
Contributor

Well maybe you could add nginx to the compose and route all traffic through that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants