Dns issue - Host Error 502 if typed www for virutal host website

Hi Everyone,

I got 1 private IP and two virtual host website.
I can browse both the website but one website is HostError -

www.server-it.co.uk - https://www.server-it.co.uk works fine
www.yastech.com or https://www.yastech.com - Host Error but to my surprise if i type url as https://yastech.om or yastech.com in my browser it works fine.

I checked my virtual host file on apache and on Cloudflare all settings are same.
I confused and scratching my head over two days.

any suggestion is highly appreciated. I am hosting the web on my personal webserver and all the virtual host settings are same for every site.

Listen 80
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName server-it.co.uk
ServerAlias www.server-it.co.uk
ServerAlias https://www.server-it.co.uk
ServerAlias https://server-it.co.uk
DocumentRoot /var/www/server-it.co.uk/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName yastech.com
ServerAlias www.yastech.com
ServerAlias https://www.yastech.com
ServerAlias https://yastech.com
DocumentRoot /var/www/yastech.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Should i try adding the host file in my host widows host file.
example. localhost guest-desktop yastech.com server-it.co.uk www.yastech.com www.server-it.co.uk

but how come www.server-it.co.uk is working without adding this entry in my windows host file?

Not sure what i am missing.
Please help.

Issue resolved.

Hello I found the solution, my ssl was full in crypto section. changed to flexible and it works fine now.
but if anyone around to explain why we have to use flexible instead of full and why we have to use flexible for it work.

A detail explanation would definately help others please.
This issue gave me sever headache. trust me

For full SSL to work. Your origin server needs to serve content on Port 443 with a valid SSL certificate (even a self signed one shall work for Full SSL but You need a Proper SSL e.g. letsencrypt or Comodo for Full Strict mode.)

What I see here is that you’re just serving content over port 80 which means that Cloudflare can not establish contact with your server over port 443 and that’s why you’re getting 502 error.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.