我在 Microsoft Azure 上的虚拟机上运行了 Nginx 测试服务器。我能够查看我的网站,直到http://www.myTestSite.com
我决定尝试从 http 重定向到 https。我按照本教程获取 Let's Encrypt 证书,但现在超时了。这是我的http://www.myTestSite.com
新信息:https://www.myTestSite.com
default
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$
}
我究竟做错了什么?
答案1
感谢大家的回复,但事实证明,当我尝试打开端口 443 时,我搞砸了。对于源端口范围,我输入了 443,但我应该为所有内容都输入 *。