콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
6749 화면

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

아바타
취소

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

베스트 답변

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 :)


아바타
취소
관련 게시물 답글 화면 활동
1
9월 18
106
1
5월 17
8375
0
2월 25
999
2
12월 24
1333
0
7월 24
1113