我在服务器上安装了SSL,一切顺利,就像我以前在其他服务器上做的那样,但是这只是不起作用,我用sudo netstat -t -l -p -n来检查 ,我得到这个:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1062/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2560/exim tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3129/nginx tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3129/nginx
但是,当我尝试访问该网站,连接超时,现在如果我检查https://www.yougetsignal.com/tools/open-ports/端口443,它会说该端口已closures。 Nginx -t没有返回错误。
sudo iptables -L显示:
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
sudo ufw状态显示:
Status: inactive
我的default.vhost文件:
server { listen 80 default_server; # listen [::]:80 default_server; server_name _; root /jet/app/www/website/public; index index.php index.html index.htm; autoindex on; # Load configuration files for the default server block. include /jet/etc/nginx/conf.d/*.inc; #location / { try_files $uri $uri/ /index.php; # } location ~ \.php$ { #try_files $uri /index.php =404; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } server { listen 443 default_server; ssl on; ssl_certificate /jet/etc/nginx/SSL/website.crt; ssl_certificate_key /jet/etc/nginx/SSL/private/website.key; server_name _; root /jet/app/www/website/public; index index.php index.html index.htm; autoindex on; # Load configuration files for the default server block. include /jet/etc/nginx/conf.d/*.inc; #location / { try_files $uri $uri/ /index.php; # } location ~ \.php$ { #try_files $uri /index.php =404; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
Wth可能会继续?
去EC2仪表板,然后点击安全组。 select与您的实例相关的安全组,并添加下面的行
HTTP tcp 443 443 0.0.0.0/0
来源: 在Amazon AWS中设置Apache