I just installed wordpress on my LEMP server. When I attempted to access it to set it up via Firefox browser it came back with the the following popup:

You have chosen to open:

which is: application/octet-stream (420 bytes)
from https://mydomain.com

Before installing wordpress I set up a test site with all of the components of the LEMP server. I had configured my firewall for https and had acquired my SSL certificates. This site worked perfectly.

Given that my test site worked properly, the problem has to be in the wordpress installation. To install wordpress, I followed the instructions in the tutorial “How to Install WordPress with LEMP on Ubuntu 18.04” to the letter.

Does anyone have an idea what went wrong and how to fix it?

edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hello,

I believe that something is not correct with the Wordpress Nginx server block, would you mind sharing the Nginx configuration file here so that I could have a look and advice you further?

Regards,
Bobby

[Example link](file:///etc/nginx/sites-available/wrkblock)

Never tried using this link before so I’m not sure it will work. As a backup, I’ll simply copy the file contents below. Please let me know if the file got attached.

server {

listen 443 ssl; # managed by Certbot
listen [::]:443 ssl ipv6only=on; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/musingsofamaverick.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/musingsofamaverick.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

root /var/www/wordpress;
index index.html index.htm index.php;

server_name musingsofamaverick.org www.musingsofamaverick.org;

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php$ {
    include snippets/fastcgi-php.conf;
}

location = /favicon.ico { 
    log_not_found off; access_log off; 
}

location = /robots.txt { 
    log_not_found off; 
    access_log off; allow all; 
}

location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
    expires max;
    log_not_found off;
}

}

server {
if ($host = www.musingsofamaverick.org) {
return 301 https://$host$request_uri;
} # managed by Certbot

if ($host = musingsofamaverick.org) {
   return 301 https://$host$request_uri;
} # managed by Certbot


listen 80 default_server;
listen [::]:80 default_server;

server_name musingsofamaverick.org www.musingsofamaverick.org;
return 404; # managed by Certbot

}

  • More info
    Using the same server block but setting root to the directory of my test site, it works fine so when I have root set at my wordpress directory it should be picking up index.php. So here’s what’s in the file it should be picking up:

    <?php
    /**

    • Front to the WordPress application. This file doesn’t do anything, but loads
    • wp-blog-header.php which does and tells WordPress to load the theme. *
    • @package WordPress */

    /**

    • Tells WordPress to load the WordPress theme and output it. *
    • @var bool */

    define( ‘WPUSETHEMES’, true );

    /** Loads the WordPress Environment and Template */
    require( dirname( FILE ) . ’/wp-blog-header.php’ );

    From this, it doesn’t appear to be going to the wp setup page and since I haven’t setup wp yet, I have no idea what it is going to do.

    • Another clue - from the mysql error log there is the following message:

      *[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key.
      *

Submit an Answer