Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help: Sitemap URLs generated using HTTP instead of HTTPS #392

Open
g-u-x opened this issue Dec 30, 2024 · 7 comments
Open

help: Sitemap URLs generated using HTTP instead of HTTPS #392

g-u-x opened this issue Dec 30, 2024 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@g-u-x
Copy link

g-u-x commented Dec 30, 2024

📚 What are you trying to do?

Hi,
I’m trying to implement the URLs using HTTPS.
Even though the canonical url includes the correct one across all pages, for some reason the URLs are generated using HTTP.
Not an SEO expert, however I assume this is not good, even when redirects work fine.
Any help to fix this will be really appreciated :)

Image

Image

🔍 What have you tried?

A couple of ways to force the hostname using HTTPS, none of them worked.

ℹ️ Additional context

Nuxt: ^3.14.159
@nuxtjs/sitemap: ^7.0.1
@nuxtjs/i18n: ^9.0.0
Node: v18.20.5
Production website.

@g-u-x g-u-x added the help wanted Extra attention is needed label Dec 30, 2024
@harlan-zw
Copy link
Collaborator

Can you share your config and / or a reproduction? It's likely you've configured your site URL to be http://<site>

@butnothero
Copy link

the same problem

@butnothero
Copy link

Image

@butnothero
Copy link

nginx has configured all redirects to https. The application also contains canonical https urls

@harlan-zw
Copy link
Collaborator

If you can provide a reproduction for this issue I can make sure it gets solved https://nuxtseo.com/docs/sitemap/getting-started/troubleshooting#submitting-an-issue

@e0v1a
Copy link

e0v1a commented Jan 5, 2025

I encountered the same issue. My site is configured with Nginx, and the HTTPS certificate is properly set up. The .env environment variables, including the BASE_URL, are also set to use https. The entire site operates on the HTTPS protocol and has been running without any issues for a long time.

The only place HTTP is used is in the Nginx reverse proxy. The homepage (pre-rendered) and static assets are directly served by Nginx, while other SSR-related requests are proxied via HTTP to the Nuxt server at http://localhost:3000.

Could you please confirm if this setup might be causing the issue?

However, using HTTP in reverse proxy configurations for backend communication is a very common practice. Please ensure there's an option to explicitly control the protocol (http or https) for URLs generated in the sitemap through additional configuration.

Thank you!

@harlan-zw
Copy link
Collaborator

The only thing I can think of is if you didn't configure a site.url and it's falling back to using server headers to figure out what your site canonical URL is.

The module should ideally warn you when this occurs or even throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants