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

Wishlist: Add simple http to https redirection support #347

Closed
kasimon opened this issue Feb 10, 2021 · 1 comment
Closed

Wishlist: Add simple http to https redirection support #347

kasimon opened this issue Feb 10, 2021 · 1 comment

Comments

@kasimon
Copy link

kasimon commented Feb 10, 2021

Expected Behavior

Have hitch optionally also listen on port 80 (configurable) and return a http redirect to the hitch tls port for all requests.

Current Behavior

hitch is only able to listen to tls connections, so if you want http->https redirection, you have to run another webserver on port 80 only for a simple http redirect reply.

Possible Solution

In the simplest way, just redirect anything coming to http://server/whatever to https://server/whatever.

Context

Having http to https redirection is desirable for user-facing services, as it reduces irritation if the user types in the service name without the protocol. If hitch was offering this feature, it would become even more useful than it already is.

Your Environment

  • Version used: 1.5.0-1
  • Operating System and version: Debian 10
  • Source of binary packages used: OS Package
@gquintard
Copy link
Contributor

Hi,

This is something that is completely out of scope for hitch. The reason is that hitch has no concept of HTTP, which the redirect would us, so it just just can't do it.

But, if you are using varnish behind it, you can use this piece of VCL to do your bidding: https://github.com/varnish/toolbox/tree/master/vcls/redirect
You can of course simplify the code if you want, but that should provide a good base here.

I'll close this as it's not actionable, but we'll be happy to discuss and help you on one of the Varnish help channels: https://varnish-cache.org/support/

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

2 participants