1

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?

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

1 Answer 1

0

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.