Nginx SSL证书不生效

时间:2019-08-07 03:49:47

标签: nginx nginx-config

我在nginx中配置了ssl证书,但是他似乎没有生效。 这是我的配置文件

server {

listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate   /1445464.pem;
ssl_certificate_key  /1445464.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
    proxy_pass xxxx;
            proxy_redirect     off;
            proxy_set_header   Host             xxxx;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
}
location enter.php {
    include snippets/fastcgi-php.conf;
    fastcgi_pass 127.0.0.1:9000;
}

}

如果我访问了https://www.example.com/enter.php,我会得到404。然后我访问了http://www.example.com/enter.php,它就可以了。 如果我访问了https://www.example.com,它就可以了!

0 个答案:

没有答案