Force https urls

starikovm
0
starikovm
commented a month ago

What problem does this feature solve?

I have a website running on https on heroku, so https request via CNAME goes to herou and website is hosted there.
What am I experiencing now is that isHTTPS(req) function on production is returning false for these kind of requests, probably because of current hosting architecture.

I wanted to raise a PR with an option for forced https links in sitemap to avoid such issues and such situations.

What does the proposed changes look like?

Option in sitemaps module like forceHTTPS, which then creates all links with https reagrdless of request type and so on.

idea
0
NicoPennec
1.7k
NicoPennec
commented a month ago

Your issue seems duplicate from that one: https://github.com/nuxt-community/sitemap-module/issues/56

2 solutions:

  • set an hostname value in your nuxt.config.js
sitemap: {
    hostname: 'https://example.com',
    // ...
}
1
starikovm
0
starikovm
commented a month ago

@NicoPennec hostname is not an option, cause I have multi-domain website for different languages.
I ll investigate is-https package, thanks!

0
ricardogobbosouza
928
ricardogobbosouza
commented a month ago

@NicoPennec can closed?

0
NicoPennec
1.7k
NicoPennec
commented a month ago

yes, the x-forwarded-proto header is the right way if the hostname can not be set.

0
Informations
Feature Request โ€ข Open
#c69 - Created a month ago