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

HTTPS with req.headers.host icw proxy #56

Closed
Timkor opened this issue Apr 29, 2019 — with CMTY · 4 comments

Comments

Projects
None yet
2 participants
Copy link

commented Apr 29, 2019 — with CMTY

What problem does this feature solve?

I would like to generate https links while nuxt runs without ssl. The proxy handles this.

What does the proposed changes look like?

A new config property which can force the generated links to use https.

(req && `${isHTTPS(req) ? 'https' : 'http'}://${req.headers.host}`) || `http://${hostname()}`

This feature request is available on Nuxt community (#c46)

@cmty cmty bot added the cmty:feature-request label Apr 29, 2019

Timkor added a commit to Timkor/sitemap-module that referenced this issue Apr 29, 2019

@Timkor

This comment has been minimized.

Copy link
Author

commented Apr 29, 2019

I solved it by using the x-forwarded-proto header in the load balancer.

This is tested by the is-https package:
https://www.npmjs.com/package/is-https

Are there plans to keep supporting this in the future?

@NicoPennec

This comment has been minimized.

Copy link
Member

commented Apr 29, 2019

From my point of view, using x-forwarded-proto is enough, so it doesn't seem necessary to force https.

@Timkor why not just set the "hostname" parameter?

sitemap: {
    hostname: 'https://example.com',
    // ...
}
@Timkor

This comment has been minimized.

Copy link
Author

commented Apr 29, 2019

@NicoPennec
Ok, then I will keep it that way.

I have multiple domains connected to my nuxt app. Like:

example.com
example.de
example.fr
example.it
example.es
@NicoPennec

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

@Timkor I closed the initial topic. But you have an interesting use case and so I need more details for a future feature 😉

Do you need multiple sitemaps or always the same sitemap for each domain name (except for a dynamic hostname) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.