Turning off https

I have a web site which runs old forum software (I won’t go into the reason, but I need to do this for a while longer). It is known not to work well when accessed using https, but served by Apache on my old server that wasn’t a serious problem. However, now I am attempting to get it running under Caddy 0.95. First I did a simple setup:

qc-test-forum.cassland.org {
	root ..\SMF-v2.0
	fastcgi / 127.0.0.1:9123 php
	log .\Logs\QCaccess.log
	errors .\Logs\QCerror.log
}

When I run it in this manner, I keep getting:
502 Bad Gateway
with a corresponding log entry reading:
27/Jan/2017:16:19:37 +0000 [ERROR 502 /index.php] read tcp 127.0.0.1:55869->127.0.0.1:9123: wsarecv: An existing connection was forcibly closed by the remote host.
However, refreshing the page brings up the content and the error alternately, and the padlock indication keeps alternating its state as well.

So I though I’d just run it http only. I change the Caddyfile to:

http://qc-test-forum.cassland.org:80 {
	root ..\SMF-v2.0
	fastcgi / 127.0.0.1:9123 php
	log .\Logs\QCaccess.log
	errors .\Logs\QCerror.log
}

But Caddy continued forcing https and then complaining that there was no site at port 443. My
next idea was to try:

https://qc-test-forum.cassland.org {
	redir / http://qc-test-forum.cassland.org
}

http://qc-test-forum.cassland.org:80 {
	root ..\SMF-v2.0
	fastcgi / 127.0.0.1:9123 php
	log .\Logs\QCaccess.log
	errors .\Logs\QCerror.log
}

This then restored the previous behaviour, with the same errors.

I should say that there are other sites on the same server which are properly using https; I can show the whole Caddyfile if required, but I suspect it wouldn’t help.

Can you either explain the errors or tell me how to make the site http only with no whiff of https?

Thanks,
Paul

Caddy was doing it right, your browser was probably caching the permanent redirect from HTTP → HTTPS.

Thanks, stupid me didn’t think of the browser cache - So I totally cleared the browser cache, and the issue of trying https has gone right away. (Incidentally, I’m using Opera, which caches very agressively - more than it’s supposed to I suspect.)

However, I am still getting the error message that I reported on alternate refreshes of any page. Any ideas where that might be coming from?

Paul

Make sure your backend isn’t doing anything funny with the response, like redirecting or something. Check request and response headers, etc.

It seems that there is some caching going on in PHP (as I understand that Caddy has none); when I returned next day to investigate what was going on, normal behaviour had returned and I was unable to replicate the problem.

Sorry for the noise…

Paul

There’s a chance it may not be noise. See this issue: https://github.com/mholt/caddy/issues/1204

I would love your help in finding and fixing this problem. Will you help us?

Yeah, sure. I’ll want to keep my other websites active, but don’t mind occasional restarts during testing. I guess the first thing I should try to do is replicate the issue as I saw it on my test site by going back and repeating the changes in whether or not I’m using https. If I can, then you’ll need to tell me how to proceed further, unless finding a way for you to replicate it yourself is sufficient.

Paul

Either a sure way to replicate it myself (at least half of the time would be nice, if it is still spurious) or a way to observe it repeatedly on your system will be fine – but the first will be easier. We just need access to watch the behavior and deploy modified binaries for debugging if we watch it on your server, that can get a little tedious. Thanks!

OK. I’ll try to find time to replicate it tomorrow, but give me a few days in case I get busy (you’ve no idea how busy being retired can get!).

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.