Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
5933 Vizualizări

I've got a problem the werkzeug parameter url_root gets set to http and not https. I've got a proxy server that has handels ssl and then redirects connections to my internal servers on port 80. Odoo 12 websites to one server and Odoo 14 sites to a different server.

Those servers have nginx as a reverse proxy. In odoo .conf the proxy_mode = True.

The nginx server record:

listen  80;
server_name ;
add_header Content-Security-Policy upgrade-insecure-requests;
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 $scheme;
proxy_redirect off;

location / {
proxy_pass http://odoo;
}

location /longpolling {
proxy_pass http://odoo-lp;
}

What do I have to do that the url_root parameter will be set correct to https://?

Imagine profil
Abandonează

aah that typical Odoo :) no answer for trivial questions :)

Autor

@oodo-odoo you have to create a self signed cert for the connection between the proxy and odoo server.

That is not true. Odoo can run without SSL in the backend on port 8069 and apache or nginx terminates SSL. Between Odoo and proxy you don't need SSL config. (I honestly don't even know how to configure SSL directly with Odoo or I had already done it.
It's probably one of those other conveniently hidden features that you have to figure out yourself :)

I have set the proxy variables correctly in my apache configuration and it went from http to https in the sitemap.

If you make a change make sure to delete the sitemap-*.xml in the ir.attachments (Settings, Technical, Attachments) so it gets regenerated.

You'd need these settings in apache vhost:

RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Host example.com
ProxyPreserveHost On
ProxyRequests Off

You can also use $host instead of example.com. However if this site has multiple domain names and the sitemap is regenerated through one of the other domain names it will have that one in the generated sitemap.

Cel mai bun răspuns

Following on the answer above.. Here is the nginx version that needs to be written in order Odoo to recognize the https... You can either put it in the location or in the server block.

        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host example.com;
        proxy_set_header Host $host;
Imagine profil
Abandonează
Cel mai bun răspuns

I have set the proxy variables correctly in my apache configuration and it went from http to https in the sitemap.

If you make a change make sure to delete the sitemap-*.xml in the ir.attachments (Settings, Technical, Attachments) so it gets regenerated.

You'd need these settings in apache vhost (there's equivalents for nginx):

RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Host example.com
ProxyPreserveHost On
ProxyRequests Off

You can also use $host instead of example.com. However if this site has multiple domain names and the sitemap is regenerated through one of the other domain names it will have that one in the generated sitemap.


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
ian. 23
3499
2
iul. 25
6034
1
sept. 22
398
0
sept. 22
803
2
iun. 22
3322