Error 502 on proxy

Hi, am having a strange behaviour with Caddy and one application that am running in Golang. I have a subdomain pointing to my server:

Server IP:
Golang Application running on Port 4445

When I type in the browser I receive 502 Bad Gateway
When I type in the browser I can see correctly the website

My configuration for this site in the caddy file is: {
    proxy / {
      max_fails 1
    log logs/mysite.log

I’m using proxy and redirecting to https because I nedd the site to works only in https. I checked the logs file and this is what I have: - - [27/Jul/2017:16:26:41 +0000] "GET / HTTP/2.0" 502 16

Please try this, I think it will fulfill your requirements, {
proxy / { transparent insecure_skip_verify max_fails 1 }
log logs/mysite.log

In case of, you’re not looking for ACME certifications at the time being, the command


can be replaced by

tls /etc/path/to/crt/file /etc/path/to/key/file

@vClouds The tls directive is not required. That is not the problem here.

@Sredny_M_Casanova What does your error log say? (You’ll need the errors directive.)

Hi, I made what you said. And this is what I get:

27/Jul/2017:22:19:05 +0000 [ERROR 502 /login] tls: oversized record received with length 20527

Please ignore tls line and proceed with errors directive as advised by @matt
I tried to help by providing my configurations @matt is the expert right here

1 Like

@vClouds Thank you for participating, though. Please continue to learn and be a part of our community!

@Sredny_M_Casanova It looks like your backend is sending invalid TLS records. What software is powering your backend?

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