Get sitemap.xml from canonical domain with redirect to subdomain

Hi everyone! I just started with my Ghost Blog (https://www.jeremypuchta.com/) and almost finished the whole setup. I am using the newest Ghost version (2.0.0). The final step I want to do is to submit the sitemap.xml to Google Search Console. I wanted to redirect every call to https://www.jeremypuchta.com, which is why I am using a redirect in the nginx configuration files ($url.com.conf and $url.com-ssl.conf). Here is the com.conf - file as an example:

jeremypuchta.com.conf

server {
listen 80;
listen [::]:80;

server_name jeremypuchta.com;
root /var/www/ghost/system/nginx-root;

location / {
    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_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2368;
    return 301 http://www.jeremypuchta.com;
}

location ~ /.well-known {
    allow all;
}

Now when I am trying to access _https://jeremypuchta.com/sitemap.xml_ it immediately redirects to _https://www.jeremypuchta.com/sitemap.xml_ but of course, there is none configured. I already tried to clear my cache as suggested in another thread. Also, I tried to temporarily remove those redirects from the canonical domain to access sitemap.xml but as well without success.

Do you have any ideas on how to proceed? Is it possible to redirect the sitemap.xml as well?
Thanks in advance.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.