smooth
1
Hi there - I’m trying to create a simple http proxy server via Fly that routes requests through an upstream proxy.
Locally works fine, in production I get SSL errors. I’m guessing it’s a cert issue but I’m not sure what kind of cert is needed.
Trying to run a simple:
❯ curl -x https://simple-proxy-server.fly.dev https://httpbin.org/ip
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to httpbin.org:443
❯ curl -x http://simple-proxy-server.fly.dev https://httpbin.org/ip
curl: (56) Recv failure: Connection reset by peer
(Ideally I’d use the dedicated IPv4 address rather than the domain, but that doesn’t work at all)
Been banging my head all day trying to get this simple thing to work
What do I do??
Thank you!
Hi… The following variant worked for me:
$ curl -4 -x https://simple-proxy-server.fly.dev http://httpbin.org/ip
{
"origin": "68.6.203.162"
}
I’d guess you just need to install ca-certificates
(if it’s a Debian-based image) on the simple-proxy-server
Machines,
.
Hope this helps a little!
smooth
4
Thanks for the reply – I already have ca-certificates installed on the image, this is what I have in the dockerfile
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
Hm… How about this approach?
(And see also the caveats about dedicated addresses, for IPv4, if you haven’t already.)
smooth
6
Sweet, it works now as an HTTP proxy.
curl --proxy “http://simple-proxy-server.fly.dev” “https://httpbin.org/ip”
Thanks to you link, I did switch to this “services” setup in fly.toml:
[[services]]
internal_port = 8080
processes = ["app"]
protocol = "tcp"
[[services.ports]]
force_https = false
handlers = []
port = 3128
[[services.ports]]
handlers = []
port = 443
Thank you
1 Like