安装ssl证书Nginx端口443拒绝连接

use*_*793 1 ssl nginx

我已经安装了我的证书并配置了我的nginx来监听端口443.但仍然无法连接到端口443.缺少一些东西?

在我的ssl.conf中

HTTPS服务器配置

#

server {
listen   443 ssl;
server_name  www.newbullets.co.nz newbullets.co.nz;

ssl                  on;
ssl_certificate  /etc/ssl/certs/ssl-bundle.crt;
ssl_certificate_key  /etc/ssl/server.key;

ssl_session_timeout  5m;


#location / {
#    root   html;
#    index  index.html index.htm;
#}
Run Code Online (Sandbox Code Playgroud)

}

和default.config

server {
listen   80;
server_name  newbullets.co.nz www.newbullets.co.nz;
#charset koi8-r;
#access_log  logs/host.access.log  main;

location / {
 auth_basic "input you user name and password";
 auth_basic_user_file /var/www/www.newbullets.co.nz/.htpasswd;
    root   /usr/share/nginx/html/nb/;
    index  index.html index.htm index.php;
    try_files $uri $uri/ @handler;
}
Run Code Online (Sandbox Code Playgroud)

更新

我在我的ssl.conf中添加了以下内容,现在在Firefox中它显示了网页,但SSL绿色栏已经消失,Chrome仍然会下载该网页.任何的想法?

 location ~ \.php$ {
    root           html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html/nb$fastcgi_script_name;
    fastcgi_param MAGE_RUN_CODE default;
    fastcgi_param MAGE_RUN_TYPE store;
    include        fastcgi_params;
}
Run Code Online (Sandbox Code Playgroud)

小智 7

  1. 检查防火墙并确保端口443已打开.默认防火墙配置通常不会打开443和80.
  2. 确保使用来自某处的include调用ssl.conf.我已经打败了一个不起作用的配置,似乎只是发现它没有被包含和加载.
  3. 将"listen"指令更改为: listen 443 default_server ssl;