If I wanted to intercept all server requests that ...
# ktor
s
If I wanted to intercept all server requests that aren't https, and aren't prefixed with
www
, and redirect to the
<https://www>.
version of my site - what would be the best way to do that?
g
I would do this on proxy/balancer level
d
There are of course many solutions to this problem; but I found 'Traefik' to be an excellent fit: https://traefik.io/
😃 1
Highly configurable and light HTTP (Reverse) Proxy that will also help you with TLS termination & HTTPS redirects.
s
Sure - that's if your project has a proxy / balancer though. I need to do this with ktor.
g
I wouldn’t say that it’s “the best way”, but what is problem to do that with ktor just by writing own interceptor? Something like this https://ktor.io/advanced/pipeline/route.html#how-to-intercept-preventing-additional-executions
c