如何在Ubuntu 16.04上使用python-certbot保护Nginx

问题描述 投票:0回答:1

我正在努力解决以下问题。我在digitalocean.com服务中有一个Droplet,我在其上安装了ubuntu 16.04服务器。在这台服务器上,我安装了Nginx HTTP服务器。对于此服务器,我想连接Google Domains购买的域名,这需要与服务器建立SSL连接。为了获得证书,我开始了本教程:https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04我安装了python-certbot-nginx并开始配置Nginx。域名认证开始时,存在与Google DNS相关的错误:

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for placeholder.app
http-01 challenge for www.placeholder.app
Waiting for verification ...
Cleaning up challenges
Failed authorization procedure. www.placeholder.app (http-01): urn: ietf: params: acme: error: dns :: 
DNS problem: NXDOMAIN looking up A for www.placeholder.app

IMPORTANT NOTES:
- The following errors were reported by the server:

Domain: www.placeholder.app
Type: None
Detail: DNS problem: NXDOMAIN looking up A for
www.placeholder.app

这个问题有什么简单的解决方案吗?

http nginx dns ssl-certificate ubuntu-server
1个回答
1
投票

我建议在线下载SSL证书,然后将其包含在Nginx配置文件中。

$ Sudano / / tc / xんx / f f d / at lt。 Kon f

编辑您的配置,让服务器使用http2侦听端口443。

listen       443 http2;
listen       [::]:443 http2;
server_name  localhost;

然后在它下面,添加SSL证书密钥的路径。

ssl        on;
ssl_certificate         /etc/certificate/public/certificate.pem;
ssl_certificate_key     /etc/certificate/private/certificate.key;

保存并退出。

现在把你的公钥放在这里:

$ Sud Nano / tc tc / Ser Chi Fu / /ぃbぃc / Ser Chi Fuて。 Pe m

你的私钥在这里:

$ Sudo nano / tc tc /ぃぃ/ / p p / / rちぃ。只有ÿ

您现在已经安装了SSL证书。请重新启动nginx服务器以使更改生效。

$ sudo systemctl restart nginx.service

Reference

© www.soinside.com 2019 - 2024. All rights reserved.