After a fresh install of ISPConfig 3 I added some site. Now the strange problem was HTTP version was always opening the default Apache page. But the HTTPS version was opening the proper site.
Solution:
Disable the default website
a2dissite 000-default.conf
The reason for HTTP version opening default site and HTTPS opening proper site:
When Apache is installed it installs a default website (normally /etc/apache2/sites-enabled/000-default.conf). This default website doesn’t have any HTTPS version, only the HTTP version is installed.
Now when the HTTP version of my site was being requested it was opening the HTTP version of the default site as the HTTP version was existing. But as there was no HTTPS version of the default site so when the HTTPS versionĀ of my site was being called no default site was matching and hence it opened the proper site.