Web not working after ssl installing

So! Hello everyone, I have a problem after ssl installing, the web seems to not find its directory, using nginx.

My domain is: purplenode.lv

I ran this command: Installed ssl.

It produced this output: Of not being able to log in the web.

My web server is (include version): Nginx

The operating system my web server runs on is (include version):ubuntu 16.04

My hosting provider, if applicable, is:Contabo

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):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):certbot 0.31.0
Download to the config: https://drive.google.com/open?id=1F5-KSPBlrH8Y-z941AcYjmt8v1tU2Gw0

1 Like

Hi @Gustavs

that's not a command. Please share the command you have used.

Checking your domain there is one new certificate - https://check-your-website.server-daten.de/?q=purplenode.lv#ct-logs

Issuer not before not after Domain names LE-Duplicate next LE
Let's Encrypt Authority X3 2019-10-24 2020-01-22 panel.purplenode.lv, purplenode.lv - 2 entries duplicate nr. 1

But your domain is invisible, only ConnectFailures. No port 80, no port 443.

And your config file is wrong, there are three

server_name purplenode.lv

only one is allowed. And you have a redirect to https in one 443 - block.

Looks like you have merged different results in one file.

1 Like

I have ran this command 1. sudo apt-get install certbot python-certbot-nginx, could you please edit the config file? I’m not really smart in these things.

1 Like
server {
    server_name purplenode.lv;

    root /var/www/html;
    index index.html index.htm index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string =404;
    }

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

    access_log off;

    # allow larger file uploads and longer script runtimes
    client_max_body_size 100m;
    client_body_timeout 120s;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_PROXY "";
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }

    location ~ /\.ht {
        deny all;
    }

    listen 443 ssl; # managed by Certbot
    listen [::]:443 ssl; # ? ? ? IF YOU HAVE IPv6
    ssl_certificate /etc/letsencrypt/live/purplenode.lv/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/purplenode.lv/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

}
1 Like

Now your site works. http and https.

https://purplenode.lv/
1 Like

If I do purplenode.lv, it doesn’t direct me to the web, earlier it did, before ssl.

Thank you, I will give it a shot, I’ll let you know what happens afterwards.

@rg305 My web works, however, it won’t redirect to the right place, if you do purplenode.lv right now, it won’t show the web, only if you do https://purplenode.lv

Also, when I attempt to log in, afterwards it again shows the error 404.

please show the main config file (and any other config files)

@rg305 https://drive.google.com/open?id=1DdbJsfNHsWyM81eGmSKtRaiAwQZwS0YW

Please show:
ls -l /etc/nginx/conf.d/*.conf
ls -l /etc/nginx/sites-enabled/*

@rg305 https://a.cockfile.com/1P7wA4.png the “default” is the one i sent you earlier, the first one, the pterodactyl all works. panel.purplenode.lv

Please show:
sudo ls -l /etc/nginx/conf.d/

show whichever file you haven’t already shown from:
/etc/nginx/sites-enabled/default
/etc/nginx/sites-enabled/pterodactyl.conf

Conf.d is completely empty. https://a.cockfile.com/V280uP.conf the pterodactyl

ok append this to end of the default file:

server {
   if ($host = purplenode.lv) {
       return 301 https://$host$request_uri;
   } # managed by Certbot
   listen 80;
   server_name purplenode.lv;
   return 404; # managed by Certbot
}

that should fix the redirection from http to https

try this for the login problem:
change (the order):
index index.html index.htm index.php;
index index.php index.html index.htm;

1 Like

hatebin like this?

more like this:

# Default server configuration
#
server {
    server_name purplenode.lv;

    root /var/www/html;
    index index.php index.html index.htm;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string =404;
    }#location

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

    access_log off;

    # allow larger file uploads and longer script runtimes
    client_max_body_size 100m;
    client_body_timeout 120s;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_PROXY "";
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }#location

    location ~ /\.ht {
        deny all;
    }#location

    listen 443 ssl; # managed by Certbot
    listen [::]:443 ssl; # ? ? ? IF YOU HAVE IPv6
    ssl_certificate /etc/letsencrypt/live/purplenode.lv/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/purplenode.lv/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
}#server

server {
   listen 443;
   listen [::]:443;

   server_name purplenode.lv;

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

   location / {
       try_files $uri $uri/ =404;
   }#location
}#server

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

   listen 443;
   server_name purplenode.lv;
   return 404; # managed by Certbot
}#server

server {
   if ($host = purplenode.lv) {
       return 301 https://$host$request_uri;
   } # managed by Certbot
   listen 80;
   server_name purplenode.lv;
   return 404; # managed by Certbot
}#server
1 Like

hatebin so, like this?

you have two extra “}” at the bottom
must be removed to keep balance “{” with “}”

1 Like