首页 > 解决方案 > 如何让 nginx 将getssl 确认请求发送到正确的位置?

问题描述

我在我的服务器上为我的个人网站 codybugstein.com 使用 NGINX,该网站在带有 Angular 前端的 NodeJS 上运行。

问题是,当我尝试使用 获取 SSL 证书时getssl,我收到一条错误消息:

cody@codyb-droplet:~$ ./getssl raphi.ca
codybugstein.com: no certificate obtained from host
Registering account
Verify each domain
Verifying codybugstein.com
copying challenge token to ~/production/client/ssl/Ysawagl1evwBenMThy*******lk28QUP0tFfqs
getssl: for some reason could not reach http://codybugstein.com/.well-known/acme-challenge/Ysawagl1evwBenMThy*******lk28QUP0tFfqs - please check it manually

如何让 nginx 正确处理这个挑战文件

这是我的 nginx 配置(/etc/nginx/sites-available/codybugstein.com):

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;

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

    server_name _;

    location / {
        proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
    }

}

标签: nginxssl-certificatelets-encryptgetssl

解决方案


推荐阅读