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

Redirect http to https? #67

Open
magnus80a opened this issue Oct 2, 2018 · 4 comments
Open

Redirect http to https? #67

magnus80a opened this issue Oct 2, 2018 · 4 comments

Comments

@magnus80a
Copy link

magnus80a commented Oct 2, 2018

Is it possible to do redirect from http to https using redirects? If so, how?

Something like this

redirects: [{
            source: "http://**",
            destination: 'https://**',
            type: 301
        }]

but source is phrased incorrectly or the protocol part cannot be used.

@MichaelTONeill
Copy link

I just debugged it because I was wondering the same. It sends in a relative path for comparison. So redirects is not the way.

@jflayhart
Copy link

jflayhart commented Apr 29, 2020

Anyone figure out how to do this? I had tried the same as @magnus80a and now I'm here :)

It seems the only other option is creating your own node server.

@JohnForster
Copy link

JohnForster commented Mar 6, 2021

I'd love for there to be a drop-in serve.json option that would do this every time. Is this something that could be added?

@warren-bank
Copy link

shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve

see: the --force-https option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants