Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1597 Näkymät

Hi there

I have use odoo 17 community 


I have problem when edit website, I use docker(source, db) and haproxy native config response domain.


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


This is my config

odoo.conf

.....
proxy_mode = True

haproxy.cfg

global   
​daemon
​maxconn 100000

defaults
​log
​global
​mode http
​option httplog
​option dontlognull
​timeout connect 5000
​timeout client 50000
​timeout server 50000

frontend front_http
​bind *:80
​redirect scheme https code 301 if !{ ssl_fc }

​redirect scheme https if { hdr(Host) -i course.domain.com } !{ ssl_fc }
​redirect prefix https://course.domain.com code 301 if { hdr(host) -i course.domain.com }

frontend front_https
​bind 0.0.0.0:443 ssl crt-list /etc/haproxy/crt-list.txt
​http-request set-header X-Forwarded-Proto https

​acl domain1 hdr(host) -i course.domain.com
​use_backend web_course if domain1

​default_backend web_course

backend web_course
​balance roundrobin
​server s1 127.0.0.1:8069 check


Image  https://tppr.me/37Iy9d

Could anyone guide me on how to achieve this in Odoo? Any help or pointers would be greatly appreciated!


Thank you very much.

Avatar
Hylkää
Tekijä

I change use nginx problem resolve

my config nginx odoo.conf (change odoo.test to your domain)

#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

server {
listen 127.0.0.1:80;
server_name odoo.test;
rewrite ^(.*) https://$host$1 permanent;
}

server {
listen 127.0.0.1:443 ssl;
server_name odoo.test;

proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;

# ssl on;
ssl_certificate /usr/local/etc/ssl/odoo.test.crt;
ssl_certificate_key /usr/local/etc/ssl/odoo.test.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;

# log
access_log /usr/local/var/log/nginx/odoo-access.log;
error_log /usr/local/var/log/nginx/odoo-error.log;

# Redirect websocket requests to odoo gevent port
location /websocket {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
proxy_cookie_flags session_id samesite=lax secure; # requires nginx 1.19.8
}

# Redirect requests to odoo backend server
location / {
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://odoo;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
proxy_cookie_flags session_id samesite=lax secure; # requires nginx 1.19.8
}

# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
helmik. 25
1005
4
tammik. 25
1749
0
syysk. 24
768
1
kesäk. 24
1661
2
toukok. 24
1233