Issue with lxc launch: proxy and image download

I have an issue with lxc and the fact I am behind a proxy (I think).

In Ubuntu, I have set $http_proxy and $https_proxy env vars and also in lxc config but when I do:

sudo lxc lauch ubuntu:16.04

I get:

Error…proxyconnect tcp: EOF

Note I need to pass my username and password when using the proxy: i.e.:

http_proxy = http://username:password@<IP>:<port>/

which I have mirrored in lxc config:

sudo lxc config set core.proxy_http http://username:password@<IP>:<port>/

With the env vars set the internet works for e.g. apt-get but not lxc

Is my syntax correct and am I setting the proxy in lxc config correctly?

It was a config error. I was using:

sudo lxc config set core.proxy_https https://username:password@<IP>:<port>/

instead of correct:

sudo lxc config set core.proxy_https http://username:password@<IP>:<port>/

Ah yeah, that’s a pretty common one. Most proxy servers don’t actually listen on https themselves, they just forward https when receiving a CONNECT request over http.