I have multiple websites on my server, and just one of them is through https (say : https://admin.example.com).
But if an user tries to access to https://www.example.com, he got a warning about an invalid SSL certificate, dedicated to admin.example.com and wrong for www.example.com (obviously!).
I'd like to redirect every https request that is not for admin.example.com to the original host, but in http, is this possible?
To be clear :
- https://admin.example.com : no redirect
- http://admin.example.com : redirect to https://admin.example.com (done via NGinx configuration)
- https://whatever.example.com : redirect to http://whatever.example.com
- https://whatever.example.com/query/string?complex=1 : redirect to http://whatever.example.com/query/string?complex=1
Is this possible via iptables? if so, how?
Thank you for your help, I appreciate :)