- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 nginx 为我的 digital ocean 服务器配置 ssl,但我遇到了问题。我在同一台服务器上有 4 个网站,其中 3 个运行良好,但最后一个似乎反复无常。要设置我的证书(使用 ssl 启用 https),我正在按照本教程(使用 letsencrypt)进行操作: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
我明确表示我对 4 个网站使用相同的证书。运行此命令时出现的问题
sudo letsencrypt certonly -a webroot --webroot-path=/projects/mysite/staging/backend -d staging.backend.mysite.com -d www.staging.backend.mysite.com
它返回这个错误:
Failed authorization procedure. staging.backend.mysite.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://staging.backend.mysite.com/.well-known/acme-challenge/jyYxmJYByVQS_HPf7at04LZkirwKe3rOHCeMYcNk1XA: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>", www.staging.backend.mysite.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.staging.backend.mysite.com/.well-known/acme-challenge/-CPeTAThAt2XBMP28LiJmaJxhWDgtU6ysRvgfVv3o5s: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: staging.backend.mysite.com
Type: unauthorized
Detail: Invalid response from http://staging.backend.mysite.com
/.well-known/acme-
challenge/jyYxmJYByVQS_HPf7at04LZkirwKe3rOHCeMYcNk1XA: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"
Domain: www.staging.backend.mysite.com
Type: unauthorized
Detail: Invalid response from
http://www.staging.backend.mysite.com/.well-known/acme-
challenge/-CPeTAThAt2XBMP28LiJmaJxhWDgtU6ysRvgfVv3o5s: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.
当我尝试到达 http://staging.backend.mysite.com/ 时使用 Chrome,它会返回此错误:
NET::ERR_CERT_COMMON_NAME_INVALID
这是我的 nginx 配置:
server {
listen 80;
listen [::]:80;
server_name staging.backend.mysite.com www.staging.backend.mysite.com;
location / {
proxy_pass http://127.0.0.1:8900/;
}
}
server {
listen 8900;
server_name my.site.ip.adresse;
location = /favicon.ico {
access_log off;
log_not_found off;
}
location /static/ {
root /projects/mysite/staging/backend;
}
location /media/ {
root /projects/mysite/staging/backend;
}
location ~ /.well-known {
allow all;
}
location / {
proxy_pass http://unix:/projects/mysite/staging/backend/run/mysite.sock;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
}
}
如您所见,服务器 block 上没有 ssl 配置,因为教程说稍后添加它。它适用于其他 3 个站点。我的配置有问题吗?
最佳答案
我通过禁用 nginx 中的代理并确保 .well-known 在我的 http 根目录中来解决这个问题(你的 8900 服务器 block 中没有根指令,添加一个作为临时指令。这必须指向文件系统中的一个目录,这将是/projects/mysite/staging/backend/.well-known 基于你给 letsencrypt 命令的 webroot 路径)。
确保您可以从浏览器访问 sample.com/.well-known,运行 Let's Encrypt 安装,然后重新打开您的代理。
您的 .well-known block 应该不是必需的。也不确定为什么你在 nginx 中同时在 80 和 8900 上服务。为什么不直接将 80 代理到您的套接字并跳过在 8900 上的服务?
关于ssl - letsencrypt 和 nginx 404 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43636914/
我有一个以以下方式运行的简单docker容器: docker service create --name nginx_proxy \ --mount type=bind,source=/opt/n
所以我有一个在端口 443 上运行的 Apache 服务器和在最新版本的 Ubuntu 上安装的 NodeJS。现在我的一切都运行得很好,除了我运行 NodeJS 服务器的端口 100 上没有 SSL
所以我删除了证书,认为我需要这样做,因为我得到了一个新域名。我目前被当前错误困住了: Root@Site:~$ certbot-auto --apache -d example.io -d www.e
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我关注了this tutorial使用 NGINX Ingrss Controller 和带有 letsencrypt 的证书管理器为基本应用程序提供服务。 我可以访问该网站,但 SSL 证书已损坏,
我正在将我的网站推送到 Ubuntu 18.04 上的 AWS Lightsail 实例,但自从我安装了 LetsEncrypt(之前一切都很好)后,我无法访问它。 基本上,我没有得到任何回应,尽管看
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我正在尝试找出如何在不影响用户/客户的情况下将网站/服务器从 digitalocean Droplet 迁移到 Azure (AKS)。 digitalocean 配置具有由letsencrypt(通
我正在尝试找出如何在不影响用户/客户的情况下将网站/服务器从 digitalocean Droplet 迁移到 Azure (AKS)。 digitalocean 配置具有由letsencrypt(通
我正在遵循本指南:https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-certificates-f
我在尝试运行命令时遇到这个奇怪的 letsencrypt 错误 $ certbot certonly --standalone --email example@gmail.com --agree-to
Closed. This question needs details or clarity。它当前不接受答案。
我正在尝试在 DigitalOcean 服务器上的 ubuntu 14 上安装 letsencrypt,但遇到了这个问题。 我尝试使用 sudo 安装但同样的错误,也尝试安装库但没有任何反应。 apt
我已经在我的服务器上安装了 SSL 来保护我的域,现在发生的事情是我在 Chrome 等中遇到了这个错误: Attackers might be trying to steal your inform
我目前在我的服务器上使用 letsencrypt 作为 SSL 证书。随着我服务器上的站点数量不断增加,安装运行 ssh 命令的证书变得非常耗时:letsencrypt。我必须手动取消选中我不想安装
当时,我无法再解决问题了……说真的,我太蠢了,检查了 letsencrypt ssl 并同时创建了一个自签名证书。但是,我认为我已经破坏了 SSL 配置。使用 letsencrypt 的其他域,除了一
我已经在 WHM 上安装了 lets encrypt,但它不适用于域。我希望每当我添加域(附加域)时,它都会被分配让加密但它会 self 分配,这表明网站不安全并且无法在 HTTPS 上运行。 我 c
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwa
我正在尝试在需要时自动为新服务器提供午餐,但在使服务器上线之前我在获取证书时遇到了一些困难。我想要做的是运行一个安装脚本,它准备好所有的包、网站和证书,然后将服务器添加到生产环境中。但是,Letsen
我有一个 digitalocean 服务器(ubuntu 16.4 nginx)+ serverpilot我按照站点教程安装了 letsencrypt:https://www.robertwent.c
我是一名优秀的程序员,十分优秀!