I’m setting up a new webshop with Magento, to offload ssl and security I put Cloudflare in front with the Cloudflare plugin installed. The webshop itself does not have a certificate, as the varnish cache server does not support that. However when I switch on flexible ssl on Cloudflare I get into a redirect loop.
Is there a way around that? Or should I put another ssl proxy in front of varnish (Cloudflare -> ssl proxy -> varnish cache server -> apache hosting Magento)?
You cant offload SSL. You will still need to have a valid certificate on your server.
Particularly with a webshop your should never use Flexible.
If Varnish does not support SSL you should definitely implement that SSL proxy. That should run locally however, so that all traffic stays within the same machine.