I am trying to reverse proxy a create react app running on port 3017 into port 3000 on https, however when i visit https://localhost:3000 I get SSL_ERROR_RX_RECORD_TOO_LONG which makes no sense to me. So I thought perhaps I should delete the locally signed cert and try again? But I cannot find any info on how this is done? So perhaps somebody could explain how I’ve messed up my https proxy and also how to remove the cert?
The command you said you ran and the log output don’t seem to agree with eachother. It looks like Caddy is listening on port 2016, not port 3000.
Also I think the problem is that you didn’t tell Caddy a domain name to use, so it doesn’t have a certificate to serve. Instead of :3000, try https://localhost:3000. This will also make Caddy try to install its root CA certificate to your systems trust store if it hasn’t already.
When I swap the command to be that instead, I get the following:
caddy reverse-proxy --from https://localhost:3000 --to 127.0.0.1:3017
2021/05/18 01:48:53.431 e[33mWARNe[0m admin admin endpoint disabled
2021/05/18 01:48:53.432 e[34mINFOe[0m tls.cache.maintenance started background certificate maintenance {"cache": "0xc000324850"}
2021/05/18 01:48:53.433 e[34mINFOe[0m http enabling automatic HTTP->HTTPS redirects {"server_name": "proxy"}
2021/05/18 01:48:53.446 e[34mINFOe[0m tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000324850"}
reverse-proxy: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
I believe it doesn’t like the fully qualified domain for the --from
I have got this working in the past and how I did so is annoyingly escaping me. I do remember having to specify https though so maybe your onto somthing