I have an edge server in which a varnish and an Nginx are installed on it. I use Nginx as a reverse_proxy for SSL termination for HTTPS traffic and also forwarding HTTP traffic. Both traffics are forwarded to varnish. I have several HTTP and HTTPS sites with valid SSL which are working properly. I have a website with a lot of parked domains which is not in HTTPS. But when I search one of its link in Google, that page is shown in HTTPS and the browser tries to open it in HTTPS so I get HTTPS error!! I also have not created any virtualhost block for that domain in nginx!! I want to know is there any way to redirect a non https website to its http version or more generally redirect all websites with invalid SSL to their HTTP version? If it can be done, should anythings be changed in varnish too?
Firstly, if the domains are parked, you won't see that traffic anyway. So there's nothing you can do about it.
Secondly, if your domains -aren't- parked, and you can see the traffic, there are two options:
1: Buy / auth an SSL with someone like letsencrypt or trustico or something, and run the site on https, then redirect to http.
2: head into google webmasters, register the domains with them so that you are the owner. Tell google to reindex the website, and also tell it to remove any https links that it currently has.