varnish/hitch

Wishlist: Add simple http to https redirection support

kasimon opened this issue · 1 comments

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

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/