option to force https on heroku
See original GitHub issueI have verdaccio running in a container on heroku running in http but can be accessed through SSL using their reverse proxy. Their method of forcing redirect to https is like this:
https://devcenter.heroku.com/articles/http-routing#heroku-headers
X-Forwarded-Proto: the originating protocol of the HTTP request (example: https)
method for redirecting with node/express – see https://jaketrent.com/post/https-redirect-node-heroku/
app.use((req, res, next) => {
if (req.header('x-forwarded-proto') !== 'https')
res.redirect(`https://${req.header('host')}${req.url}`)
else
next()
})
Describe the solution you’d like
Might be great to have some way to redirect non-http to https. Not sure what would be most flexible, a configuration option where I can say “when” to redirect, something like:
redirect:
when:
header: X-Forward-Proto
is:
http
to:
https
or perhaps some javascript if statement that can be eval
ed to keep it open ended as possible
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Can Heroku force an application to use SSL/TLS?
Can Heroku force an application to use SSL/TLS? Issue. You have configured an SSL certificate and now you want your application to use...
Read more >How To Force HTTPS (SSL/TLS) on Heroku - Expedited Security
1. Security · Plain http connections being marked as insecure. · Encrypted https connections being marked as secure.
Read more >Force my heroku app to use SSL (https) - Stack Overflow
As of July 2019, Heroku supports HTTPS redirects to OTHER DOMAINS OR SUBDOMAINS (a redirect cannot point to itself) ...
Read more >Redirect HTTP to HTTPS (for Heroku) #2597 - GitHub
use nginx, convert http to https, and of course, you can configure nginx to serve SSL as well. Method II: you can build...
Read more >Installing an SSL certificate on Heroku SSL - Hosting
Heroku SSL is a free feature that allows for the managing of SSL/TLS encryption for custom domains and relies on the Server Name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ilovett Check this https://github.com/honzahommer/verdaccio-https.
Thanks @honzahommer !