I got my Nginx test server running on a virtual machine on Microsoft Azure. I was able to view my site when going to http://www.myTestSite.com
until I decided to try redirecting from http to https. I followed this tutorial to get a Let's Encrypt certificate, but now http://www.myTestSite.com
and https://www.myTestSite.com
just timeout. Here is my new default
in sites-available
:
server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
listen [::]:443 default_server;
root /var/www/html;
index Main.html;
server_name www.myTestSite.com;
location / {
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
ssl on;
ssl_certificate /etc/letsencrypt/live/www.myTestSite.com/fullchain.pem; $
ssl_certificate_key /etc/letsencrypt/live/www.myTestSite.com/privkey.pem$
}
What am I doing wrong?
/var/log/nginx/error.log
to see what the problem is.