From e1edb48a3cc06a254e91f076a1b6daf6d02fd877 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 9 Jan 2021 12:57:24 +0100 Subject: [PATCH] Redirect to https even on reverse proxy --- src/client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client.c b/src/client.c index b7c4e7e..aed59f0 100644 --- a/src/client.c +++ b/src/client.c @@ -164,6 +164,11 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int } goto respond; } + } else if (!client->enc) { + res.status = http_get_status(308); + sprintf(buf0, "https://%s%s", host, req.uri); + http_add_header_field(&res.hdr, "Location", buf0); + goto respond; } if (conf->type == CONFIG_TYPE_LOCAL) {