配置好的HTTPS服务,无法访问

浏览器访问报如下错误:
ERR_TOO_MANY_REDIRECTS

SSH curl 链接报错:
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none More details here: curl.haxx.se/docs/sslcer…

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

最后原因:
cloudflare-->mytest.com # SSL/TLS 没有选择严格
Full (strict)

Encrypts end-to-end, but requires a trusted CA or Cloudflare Origin CA certificate on the server

另外:
developers.cloudflare.com/ssl/origin-…

页面中(下方)第二步可能是多余的,不清楚作用是什么。

总之##  Nginx: Creating Your CSR with OpenSSL 这个生成里,我填的都是test,除了二级域名之外。然后去服务器站点目录下创建了一个tmp目录,再执行的ssl命令。应该是没有用上。

​​2. Install Origin CA certificate on origin server

================
其实对于cloudflare,只需要在mytest.com下设置即可。

SSL/TLS

Edge Certificates

将Always Use HTTPS 以及 Automatic HTTPS Rewrites 勾选上即可。

笔记:经过实测,开启Automatic HTTPS Rewrites后,会影响查英方文献。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将名和服务器nginx访问配置https,您需要完成以下步骤: 1. 获取SSL证书 您需要从可信的证书颁发机构(CA)购买SSL证书。一些常见的CA包括Let's Encrypt、Comodo、Symantec等等。在购买证书之前,您需要确定您的名是否已经注册,并且您有权管理该名。证书有不同的价格和类型,具体取决于您的需求。 2. 安装SSL证书 一旦您购买了SSL证书,您需要将其安装到您的服务器上。这个过程可能因为您使用的服务器和证书类型而有所不同。您应该查看您的证书提供商的文档以获取详细的安装说明。 3. 配置Nginx 一旦您安装了SSL证书,您需要配置Nginx以使用HTTPS协议。在您的Nginx配置文件中,您需要添加以下行: ``` server { listen 443 ssl; server_name example.com; ssl_certificate /path/to/your/certificate.crt; ssl_certificate_key /path/to/your/private.key; location / { # your other config goes here } } ``` 这将配置Nginx使用HTTPS协议,并将SSL证书和私钥与您的名关联起来。确保将“example.com”替换为您的名,并将证书和私钥路径替换为您实际的位置。 4. 重启Nginx 完成配置后,您需要重启Nginx以使更改生效。您可以使用以下命令重启Nginx: ``` sudo systemctl restart nginx ``` 或者 ``` sudo service nginx restart ``` 现在您的名和服务器Nginx访问已经配置HTTPS协议。您可以在浏览器中输入您的名以测试它是否正常工作。如果一切顺利,您将看到一个绿色的锁标志,表示您的连接是安全的。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值