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://?
aah that typical Odoo :) no answer for trivial questions :)
@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.