Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6903 Lượt xem

Hello,

I'm facing in issue with the sitemap generation . Odoo creates a sitemap with a domain name which is different than our website domain. 

I tried to go to settings -> technical -> attachments, then deleted the file was attached to the sitemap.xml and re-attached a new one holding my domain name. the trick only worked for a couple of days then everything corrupted again with this strange domain.


Can anyone help me fix it. Thank you

Ảnh đại diện
Huỷ bỏ

Hi,
I have the same problem, did you manage to solve it?

Câu trả lời hay nhất

This may be resolved by setting the "web.base.url" System Parameter - see https://www.odoo.com/forum/help-1/how-to-change-the-value-of-web-base-url-to-get-the-correct-header-footer-css-82516 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Just adding this here as it probably explains the situation for anyone else hitting this:

The problem is probably due to your nginx/apache config. You likely set the X-Forwarded-Host header with var $host. That is ok in most situations. However it means that nginx/apache will use the fqdn in the request from the client and will copy it over to the Odoo backend. E.g. your site is available through example\.com \(your\ "main"\ site\)\ and\ example2\.com \.\ You\ test\ it\ by\ using\ example\.com/sitemap\.xml and\ all\ is\ well\.\ A\ few\ hours/days\ later\ the\ sitemap\ is\ requested\ through\ example2\.com/sitemap\.xml \(e\.g\.\ google\ crawler\)\ and\ now\ the\ temporarily\ generated\ sitemap\ will\ have\ example2\.com in\ it\.

Set\ the\ proxy\ variables\ correctly\ in\ your apache\ configuration\ and\ it\ will\ go\ from\ http\ to\ https\ and\ also\ have\ the\ correct\ domain\ 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\.\ Yes\ this\ is\ nowhere\ mentioned\ that\ the\ sitemap\ is\ regenerated\ from\ time\ to\ time\ and\ nobody\ seems\ to\ be\ able\ to\ point\ this\ out\.\ Nor\ is\ there\ any\ mention\ on\ the\ frequency\ of\ this\ or\ the\ mechanism\ that\ triggers\ it\.

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

So\ here\ you\ have\ the\ explicit\ example.com passed to Odoo.

You might ask: how was my website reachable through this strange domain name: apache/nginx misconfiguration. E.g. the default site pointing to your Odoo install. Another misconfiguration can be setting ProxyRequests On in Apache. A similar setting will exist for nginx but having this enabled allows requests for any site to go through your Nginx and if your Odoo install is the default site it will send that request fqdn to Odoo and that one will be used in the backend. Do NOT enable ProxyRequests unless you know exactly what you're doing or if you want cache-poisoning (hint: you don't want this).

Hope this helps someone else wasting plenty of time :)


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 18
106
1
thg 5 17
8541
0
thg 2 25
1217
2
thg 12 24
1514
0
thg 7 24
1224