Hello,
My VPS has no 80 and 443 ports available for me.
I have to use two non-standard ports for http and https.
I’ve installed the latest caddy with DNS changeling plugin.
I want to realize, all http traffic redirect to https
Here’s my caddyfile.
I use caddy -conf /etc/caddy/Caddyfile -http-port 8080 to start caddy service
dnow,
the http request returns 500 internal privoxy error
the https works fine with google displays.
So could anyone help me out http request?
I hope http request will goes automaticlly to https8081, which should return google
thanks,
Jane
Edit: Actually, I don’t need to know that. I know why your browser goes to https://mydomain:8080.
The first time you connect, everything works. You connect to HTTP on port 8080, Caddy tells you to go to HTTPS on port 8081, all working.
Caddy tells your browser never to connect over HTTP, always use HTTPS. (this is Strict-Transport-Security at work)
You browse to http://mydomain:8080 for the second time.
Your browser remembers not to bother with HTTP. It changes the scheme automatically.
However, you’ve manually specified the port. Normally, the port is unspecified, so changing scheme implies changing port. But not in this case. Your browser doesn’t change the port to 8081 because it doesn’t remember which port HTTPS is on for this specific site.
This is going to keep happening as long as you use HSTS on non-standard ports.