Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hasnainali9's avatar

Error 521 Web server is down

Hey trying to access my app through vps server but it won't works with https but work fine with http. https://karachicargoservices.co/login http://karachicargoservices.co/login

I'm Using cloudflare the server also have another virtual host named which works fine both with or without https. http://pfslogistics.co/ Please let me know what is causing this issue

0 likes
10 replies
vincent15000's avatar

What server do you use on your VPS ?

Have you set up the right configuration to use https ?

Hasnainali9's avatar

@vincent15000 I'm using apache in VPS. Don't know about the configuration as i'm not an expert in it. Althought here the few file which might help you understand my configuration. Hosts File

127.0.0.1 nvmekvm2021.vps localhost localhost.localdomain localhost4 localhost4.localdomain4 pfslogistics.co
127.0.0.1 www.karachicargoservices.co karachicargoservices.co

Conf File for domain

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName karachicargoservices.co
ServerAlias www.karachicargoservices.co
DocumentRoot /var/www/karachicargoservices.co
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/karachicargoservices.co>
AllowOverride All
</Directory>
</VirtualHost>	
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName pfslogistics.co
ServerAlias www.pfslogistics.co
DocumentRoot /var/www/pfslogistics.co
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/pfslogistics.co>
AllowOverride All
</Directory>
</VirtualHost>

Ports.conf File

Listen 80
Listen 8000
Listen 8080



<IfModule ssl_module>
	Listen 443
</IfModule>

<IfModule mod_gnutls.c>
	Listen 443
</IfModule>
sr57's avatar

@hasnainali9

I just tested your url, the http does not work too ...

Does your webserver run?

Does your virtual host is enabled?

Have you checked your dns setting?

Snapey's avatar
Snapey
Best Answer
Level 122

you only have a virtual host entry listening on port 80

you need one for port 443 only

Alternatively you can have cloudflare provide the ssl and terminate it so that your server only gets http.

Hasnainali9's avatar

@Snapey Thanks for reply. i have previously connected through cloudflare but the server won't connect on https & works fine with http.

Please or to participate in this conversation.