Hi guys, i am having some troubles with https. I got the certificated, followed this guide
until the step 6, cause of it didn’t work for me.
This is my /etc/nginx/sites-available/default file
server {
listen 80 default_server;
listen [::]:80 default_server
server_name tophub.it www.tophub.it;
return 301 https://$server_name$request_uri;
}
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-example.com.conf;
include snippets/ssl-params.conf;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location ~ /.well-known {
allow all;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
and this is my ufw status
Status: active
To Action From
-- ------ ----
22 LIMIT Anywhere
443 ALLOW Anywhere
80 ALLOW Anywhere
Nginx Full ALLOW Anywhere
22 (v6) LIMIT Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)
But WHAT didn't work for you? What was the output? What was the error message? We don't have crystal balls, you know..
I see you actually used example.com from the Digital Ocean guide literally when specifying /etc/nginx/snippets/ssl-example.com.conf. Did you, in that file, also point ssl_certificate and ssl_certificate_key to files /etc/letsencrypt/live/example.com/ literally, as the guide told you? Or did you change example.com to your actual domain name?
Please provide the file
/etc/nginx/snippets/ssl-tophub.it.conf
And, in your /etc/nginx/sites-available/default file above you have “include snippets/ssl-example.com.conf;” Is that what you really have ? or do you have “include snippets/ssl-tophub.it.conf;” ?
And, in your /etc/nginx/sites-available/default file above you have “include snippets/ssl-example.com.conf;” Is that what you really have ? or do you have “include snippets/ssl-tophub.it.conf;” ?
That would be the standard linux command to create a symlink, yes. if /etc/nginx/sites-enabled/default already exists you will need to delete it first.