1. My Caddy version (caddy -version
):
Caddy v1.0.3
2. How I run Caddy:
a. System environment:
Debian 9, systemd
b. Command:
sudo systemctl start caddy.service
c. My complete Caddyfile:
https://sage.whiteteam.co.uk {
log stdout
errors stderr
bind 0.0.0.0
proxy / localhost:8090
}
3. The problem I’m having:
Context (please don’t shoot the messenger)
I am writing a ‘proof of concept’ sage pay server integration, the requirements for the integration are to expose an endpoint for sage pay to open an http (or https) request, and get a response of purely:
Status=OK
RedirectURL=https://some.domain.com/
No headers, no http protocol, no status, just the content.
Actual problem
I am proxying requests to a locally running Go http server, which hijacks the request and writes the above data to the connection. This ‘works’ if I make a request directly to the Go server, however if I use a Caddy proxy to point https requests I get the below error. The error makes sense (the response being written doesn’t conform to the http spec) but is there a way or circumventing this?
4. Error messages and/or full log output:
30/Oct/2019:09:09:51 +0000 [ERROR 502 /] net/http: HTTP/1.x transport connection broken: malformed HTTP response "Status=OK"
5. What I already tried:
As explained above I’ve tried binding the Go server port directly to 80
and all is fine, but I need Caddy as a proxy.
6. Links to relevant resources:
If anyone wants to laugh at my expense please see Elavon: Card Payment Solutions & Merchant Services