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;
        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?

  • take a look at /var/log/nginx/error.log to see what the problem is.
    – suspectus
    Aug 21, 2019 at 11:34
  • 1
    A timeout usually points toward a firewall issue. Aug 21, 2019 at 13:58
  • 1
    Check your VM firewall and Azure security rules. Aug 21, 2019 at 18:48
  • Gerald Schneider and Michael Hampton are right. It messed up when I opened port 443.
    – BladePoint
    Aug 21, 2019 at 20:43

1 Answer 1


Thanks for the replies everyone, but it turns out I messed up when I tried to open port 443. For the source port range, I put in 443, but I should have put * for everything.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .