Added Cert - Site doesn't show but wants to download page only

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: pal-auction.org

I ran this command: I installed certbot with snapd on LEMP with Ubuntu 18

It produced this output: Now when I go to the site it wants to download the index.php page instead of showing a secured page.

My web server is (include version): nginx 1.18

The operating system my web server runs on is (include version): Ubuntu 18

My hosting provider, if applicable, is: Vultr

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 1.8.0

The server is sending

<h1>pal-auction.org</h1>

However, because the server is also sending this response header:

Content-Type: application/octet-stream

the browser is causing it to appear as a download.

Does your index.php file have any other contents in it?

It's possible that your nginx HTTPS server {} is missing a PHP handler, but it would surprise me. Certbot is supposed to copy all of the directives from the HTTP server {}.

Hi @tkd5041

that's simple, see the check - https://check-your-website.server-daten.de/?q=pal-auction.org

First, your certificate is correct:

CN=pal-auction.org
	29.09.2020
	28.12.2020
expires in 90 days	pal-auction.org, www.pal-auction.org - 2 entries

So it's not a certificate problem.

Second, your header is wrong:

Content-Type: application/octet-stream

That's your download.

Change that to text/html.

PS: Curious: That blocks the Chrome screenshot function. Must fix it.

It was the original Vultr page that shows up when a server is created. I deleted file and just put in that content only trying to figure out why it was doing so.

can the content-type be in the conf file that certbot changed?

I think it's probably more likely that your nginx configuration is missing the required parts to interpret PHP files correctly.

e.g. like this: https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/#abridged-basic-setup

Instead, it sees index.php, doesn't understand what to do with it, and sends it as a binary file.

What you should do depends on which Vultr image you used, what PHP application you plan to run, etc.

Could be a certbot bug if it worked properly before, but not after installation of the LE certificate. Perhaps it didn't copy over the required directives?

Unfortunately, @tkd5041 didn't mention the exact commands used, so no way to know right now if the certificate was installed by certbot automatically or not..

1 Like

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