Nginx-使用LetsEncrypt

时间:2018-11-14 12:05:50

标签: node.js express nginx lets-encrypt

我认为,由于第一个显示host: "167.99.197.89:443"的错误,LetsEncrypt在我正在运行Nginx / Node / Express的服务器上引起服务器问题。 LetsEncrypt已在Nginx default文件的配置中添加了端口443。服务器在工作一段时间后将关闭,直到第二天我尝试加载应用程序时才意识到服务器已关闭(通过第二次错误访问http://test-project.webflow.io/test-project“),然后我看到了这些错误在日志中:

第一

  

2018/11/14 08:46:19 [错误] 32527#32527:* 852 connect()失败(111:   连接到上游时,客户端拒绝连接):   60.191.38.77,服务器:,请求:“ GET / HTTP / 1.1”,上游:“ http://167.99.197.89:3001/”,主机:“ 167.99.197.89:443”

第二

  

2018/11/14 09:53:41 [错误] 32527#32527:* 855连接到上游,客户端时,connect()失败(111:连接被拒绝):   81.143.229.121,服务器:,请求:“ GET /test-project.js HTTP / 1.1”,上游:“ http://167.99.197.89:3001/test-project.js”,主机:   “ my.domain.co.uk”,引荐来源网址:   “ http://test-project.webflow.io/test-project

Nginx默认文件

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

    root /var/www/html;

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

    server_name my.domain.co.uk www.my.domain.co.uk;    
    return 301 https://my.domain.co.uk$request_uri;
}

server {
    location / {
        proxy_pass http://167.99.197.89:3001;
        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;
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/my.domain.co.uk/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/my.domain.co.uk/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

我只是想知道我的Nginx default文件在哪里看起来有问题,可能导致服务器脱机吗?谢谢。

0 个答案:

没有答案