在新域上将Let's Encrypt与Nginx和Node.js一起使用时出现502错误网关

时间:2018-10-02 01:07:05

标签: node.js nginx lets-encrypt

我最近按照前面的两个步骤在服务器上设置了一个新域(在HTTPS上运行良好)。但是,当尝试连接到我的新站点时,我收到以下error.log

2018/10/02 00:54:33 [error] 8536#8536: *1 peer closed connection in SSL handshake while SSL handshaking to upstream, client: 88.98.209.129, server: rees.app, request: "GET / HTTP/2.0", upstream: "https://139.59.178.110:3500/", host: "rees.app"

针对此错误运行debug时,我收到:

2018/10/02 00:57:14 [debug] 8687#8687: epoll add event: fd:6 op:1 ev:00002001
2018/10/02 00:57:14 [debug] 8687#8687: epoll add event: fd:7 op:1 ev:00002001
2018/10/02 00:57:14 [debug] 8687#8687: epoll add event: fd:8 op:1 ev:00002001
2018/10/02 00:57:16 [debug] 8687#8687: accept on 0.0.0.0:443, ready: 0
2018/10/02 00:57:16 [debug] 8687#8687: posix_memalign: 000055C3AF691260:512 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 accept: 88.98.209.129:48510 fd:3
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer add: 3: 60000:1538441896702
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 epoll add event: fd:3 op:1 ev:80002001
2018/10/02 00:57:16 [debug] 8687#8687: *1 http check ssl handshake
2018/10/02 00:57:16 [debug] 8687#8687: *1 http recv(): 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 https ssl handshake: 0x16
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL ALPN supported by client: h2
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL ALPN supported by client: http/1.1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL ALPN selected: h2
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL server name: "rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_do_handshake: -1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_get_error: 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL handshake handler: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_do_handshake: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL: TLSv1.2, cipher: "ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD"
2018/10/02 00:57:16 [debug] 8687#8687: *1 init http2 connection
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF69F6F0:512 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF63FFA0:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 add cleanup: 000055C3AF6913E0
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF69F900:512 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 send SETTINGS frame ack:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 send WINDOW_UPDATE frame sid:0, window:2147418112
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 read handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: -1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_get_error: 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame out: 000055C3AF6400A8 sid:0 bl:0 len:4
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame out: 000055C3AF63FFF0 sid:0 bl:0 len:18
2018/10/02 00:57:16 [debug] 8687#8687: *1 malloc: 000055C3AF632C00:16384
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 27
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 13
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL to write: 40
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_write: 40
2018/10/02 00:57:16 [debug] 8687#8687: *1 tcp_nodelay
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame sent: 000055C3AF63FFF0 sid:0 bl:0 len:18
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame sent: 000055C3AF6400A8 sid:0 bl:0 len:4
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF63FFA0, unused: 3656
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF632C00
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer del: 3: 1538441896702
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer add: 3: 180000:1538442016709
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 idle handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF63FFA0:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 read handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: 64
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: -1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_get_error: 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 preface verified
2018/10/02 00:57:16 [debug] 8687#8687: *1 process http2 frame type:4 f:0 l:18 sid:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 send SETTINGS frame ack:1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame complete pos:000055C3AF6FC5C3 end:000055C3AF6FC5D0
2018/10/02 00:57:16 [debug] 8687#8687: *1 process http2 frame type:8 f:0 l:4 sid:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 WINDOW_UPDATE frame sid:0 window:15663105
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame complete pos:000055C3AF6FC5D0 end:000055C3AF6FC5D0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame out: 000055C3AF63FFF0 sid:0 bl:0 len:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 malloc: 000055C3AF632C00:16384
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL to write: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_write: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame sent: 000055C3AF63FFF0 sid:0 bl:0 len:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF63FFA0, unused: 3855
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF632C00
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer: 3, old: 1538442016709, new: 1538442016709
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 idle handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF63FFA0:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 read handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: 284
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: -1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_get_error: 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 process http2 frame type:1 f:25 l:275 sid:1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 HEADERS frame sid:1 on 0 excl:1 weight:256
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF69FB10:1024 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF6A0800:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF6A1810:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header name: 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 6
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: ":authority: rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 malloc: 000055C3AF69FF20:512
2018/10/02 00:57:16 [debug] 8687#8687: *1 malloc: 000055C3AF632C00:4096
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 50 free:4096
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header name: 7
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header name: 4
2018/10/02 00:57:16 [debug] 8687#8687: *1 http uri: "/"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http args: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http exten: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 24
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 7
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "cache-control: max-age=0"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 54 free:4046
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http header: "cache-control: max-age=0"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 18
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack raw string length: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "upgrade-insecure-requests: 1"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 58 free:3992
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http header: "upgrade-insecure-requests: 1"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 58
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 92
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 163 free:3934
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http header: "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 19
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 64
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 123 free:3771
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http header: "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 13
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "accept-encoding: gzip, deflate, br"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 64 free:3648
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF6A0130:512 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http header: "accept-encoding: gzip, deflate, br"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 17
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 11
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "accept-language: en,en-GB;q=0.9"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 61 free:3584
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http header: "accept-language: en,en-GB;q=0.9"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 get indexed header: 32
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack encoded string length: 38
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 add header to hpack table: "cookie: __cfduid=dcb5ea66f953195d1aeec15d5d437be411538438395"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 hpack table account: 90 free:3523
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 http request line: "GET / HTTP/2.0"
2018/10/02 00:57:16 [debug] 8687#8687: *1 generic phase: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 rewrite phase: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 test location: "/"
2018/10/02 00:57:16 [debug] 8687#8687: *1 using configuration "/"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http cl:-1 max:1048576
2018/10/02 00:57:16 [debug] 8687#8687: *1 rewrite phase: 3
2018/10/02 00:57:16 [debug] 8687#8687: *1 post rewrite phase: 4
2018/10/02 00:57:16 [debug] 8687#8687: *1 generic phase: 5
2018/10/02 00:57:16 [debug] 8687#8687: *1 generic phase: 6
2018/10/02 00:57:16 [debug] 8687#8687: *1 generic phase: 7
2018/10/02 00:57:16 [debug] 8687#8687: *1 access phase: 8
2018/10/02 00:57:16 [debug] 8687#8687: *1 access phase: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 access phase: 10
2018/10/02 00:57:16 [debug] 8687#8687: *1 post access phase: 11
2018/10/02 00:57:16 [debug] 8687#8687: *1 http body new buf t:0 f:0 0000000000000000, pos 0000000000000000, size: 0 file: 0, size: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http init upstream, client timer: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "Cookie: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "__cfduid=dcb5ea66f953195d1aeec15d5d437be411538438395"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "Host: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "X-Forwarded-For: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "88.98.209.129"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "X-Forwarded-Host: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "X-Forwarded-Server: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "X-Real-IP: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "88.98.209.129"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "X-Forwarded-Proto: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "https"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "X-Original-Request: "
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script var: "/"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: "Connection: close
"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http script copy: ""
2018/10/02 00:57:16 [debug] 8687#8687: *1 http proxy header: "cache-control: max-age=0"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http proxy header: "upgrade-insecure-requests: 1"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http proxy header: "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http proxy header: "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http proxy header: "accept-language: en,en-GB;q=0.9"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http proxy header:
"GET / HTTP/1.1
Cookie: __cfduid=dcb5ea66f953195d1aeec15d5d437be411538438395
Host: rees.app
X-Forwarded-For: 88.98.209.129
X-Forwarded-Host: rees.app
X-Forwarded-Server: rees.app
X-Real-IP: 88.98.209.129
X-Forwarded-Proto: https
X-Original-Request: /
Connection: close
cache-control: max-age=0
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
accept-language: en,en-GB;q=0.9

"
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF633C10:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http cleanup add: 000055C3AF6A27E8
2018/10/02 00:57:16 [debug] 8687#8687: *1 get rr peer, try: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 stream socket 12
2018/10/02 00:57:16 [debug] 8687#8687: *1 epoll add connection: fd:12 ev:80002005
2018/10/02 00:57:16 [debug] 8687#8687: *1 connect to 139.59.178.110:3500, fd:12 #2
2018/10/02 00:57:16 [debug] 8687#8687: *1 http upstream connect: -2
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF687DF0:128 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer add: 12: 59000:1538441895710
2018/10/02 00:57:16 [debug] 8687#8687: *1 http finalize request: -4, "/?" a:1, c:2
2018/10/02 00:57:16 [debug] 8687#8687: *1 http request count:2 blk:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame complete pos:000055C3AF6FC6AC end:000055C3AF6FC6AC
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer del: 3: 1538442016709
2018/10/02 00:57:16 [debug] 8687#8687: *1 http upstream request: "/?"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http upstream send request handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 malloc: 000055C3AF69ACC0:72
2018/10/02 00:57:16 [debug] 8687#8687: *1 upstream SSL server name: "rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 set session: 0000000000000000
2018/10/02 00:57:16 [debug] 8687#8687: *1 tcp_nodelay
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_do_handshake: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_get_error: 5
2018/10/02 00:57:16 [error] 8687#8687: *1 peer closed connection in SSL handshake while SSL handshaking to upstream, client: 88.98.209.129, server: rees.app, request: "GET / HTTP/2.0", upstream: "https://139.59.178.110:3500/", host: "rees.app"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http next upstream, 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 free rr peer 1 4
2018/10/02 00:57:16 [debug] 8687#8687: *1 finalize http upstream request: 502
2018/10/02 00:57:16 [debug] 8687#8687: *1 finalize http proxy request
2018/10/02 00:57:16 [debug] 8687#8687: *1 close http upstream connection: 12
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF69ACC0
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF687DF0, unused: 32
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer del: 12: 1538441895710
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http finalize request: 502, "/?" a:1, c:1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http special response: 502, "/?"
2018/10/02 00:57:16 [debug] 8687#8687: *1 xslt filter header
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 header filter
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 output header: ":status: 502"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 output header: "server: nginx/1.10.3 (Ubuntu)"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 output header: "date: Tue, 02 Oct 2018 00:57:16 GMT"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 output header: "content-type: text/html"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 output header: "content-length: 584"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2:1 create HEADERS frame 000055C3AF633D50: len:62
2018/10/02 00:57:16 [debug] 8687#8687: *1 http cleanup add: 000055C3AF633E58
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame out: 000055C3AF633D50 sid:1 bl:1 len:62
2018/10/02 00:57:16 [debug] 8687#8687: *1 malloc: 000055C3AF695BD0:16384
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 62
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2:1 HEADERS frame 000055C3AF633D50 was sent
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame sent: 000055C3AF633D50 sid:1 bl:1 len:62
2018/10/02 00:57:16 [debug] 8687#8687: *1 http output filter "/?"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http copy filter: "/?"
2018/10/02 00:57:16 [debug] 8687#8687: *1 image filter
2018/10/02 00:57:16 [debug] 8687#8687: *1 xslt filter body
2018/10/02 00:57:16 [debug] 8687#8687: *1 http postpone filter "/?" 000055C3AF633FD8
2018/10/02 00:57:16 [debug] 8687#8687: *1 write new buf t:0 f:0 0000000000000000, pos 000055C3AE362AC0, size: 120 file: 0, size: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 write new buf t:0 f:0 0000000000000000, pos 000055C3AE363E40, size: 62 file: 0, size: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 write new buf t:0 f:0 0000000000000000, pos 000055C3AE363C60, size: 402 file: 0, size: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http write filter: l:1 f:0 s:584
2018/10/02 00:57:16 [debug] 8687#8687: *1 http write filter limit 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2:1 create DATA frame 000055C3AF633D50: len:584 flags:1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame out: 000055C3AF633D50 sid:1 bl:0 len:584
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 120
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 62
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL buf copy: 402
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL to write: 664
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_write: 664
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2:1 DATA frame 000055C3AF633D50 was sent
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame sent: 000055C3AF633D50 sid:1 bl:0 len:584
2018/10/02 00:57:16 [debug] 8687#8687: *1 http write filter 0000000000000000
2018/10/02 00:57:16 [debug] 8687#8687: *1 http copy filter: 0 "/?"
2018/10/02 00:57:16 [debug] 8687#8687: *1 http finalize request: 0, "/?" a:1, c:1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http request count:1 blk:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 close stream 1, queued 0, processing 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 http close request
2018/10/02 00:57:16 [debug] 8687#8687: *1 http log handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF6A0800, unused: 8
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF6A1810, unused: 7
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF633C10, unused: 2750
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF69FB10, unused: 540
2018/10/02 00:57:16 [debug] 8687#8687: *1 post event 000055C3AF6D86F0
2018/10/02 00:57:16 [debug] 8687#8687: *1 delete posted event 000055C3AF6D86F0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 handle connection handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF63FFA0, unused: 3488
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF695BD0
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer add: 3: 180000:1538442016711
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 idle handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 0
2018/10/02 00:57:16 [debug] 8687#8687: *1 posix_memalign: 000055C3AF63FFA0:4096 @16
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 read handler
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: 9
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_read: -1
2018/10/02 00:57:16 [debug] 8687#8687: *1 SSL_get_error: 2
2018/10/02 00:57:16 [debug] 8687#8687: *1 process http2 frame type:4 f:1 l:0 sid:0
2018/10/02 00:57:16 [debug] 8687#8687: *1 http2 frame complete pos:000055C3AF6FC599 end:000055C3AF6FC599
2018/10/02 00:57:16 [debug] 8687#8687: *1 free: 000055C3AF63FFA0, unused: 4016
2018/10/02 00:57:16 [debug] 8687#8687: *1 reusable connection: 1
2018/10/02 00:57:16 [debug] 8687#8687: *1 event timer: 3, old: 1538442016711, new: 1538442016713

我对Nginx或任何系统管理员都不是很熟悉,所以此日志对我来说没有太大意义。我尝试删除并重新创建网站的证书文件,尽管这也没有用。主机上还有另外两个网站可以正常运行,所以我不确定这里发生了什么。

这是服务器阻止文件:

# Remove WWW from HTTP
server {
    listen 80;
    server_name www.rees.app rees.app;
    return 301 https://rees.app$request_uri;
}

# Remove WWW from HTTPS
server {
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/rees.app/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/rees.app/privkey.pem;
    server_name www.rees.app;
    return 301 https://rees.app$request_uri;
}

# HTTPS request
server {
    # Enable HTTP/2
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name rees.app;

    ssl_certificate /etc/letsencrypt/live/rees.app/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/rees.app/privkey.pem;

    location / {
        proxy_pass https://127.0.0.1:3500;
        include /etc/nginx/proxy_params;
    }
}

这是/etc/nginx/proxy_params文件:

proxy_buffers 16 32k;
proxy_buffer_size 64k;
proxy_busy_buffers_size 128k;
proxy_cache_bypass $http_pragma $http_authorization;
proxy_connect_timeout 59s;
proxy_hide_header X-Powered-By;
proxy_http_version 1.1;
proxy_ignore_headers Cache-Control Expires;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
proxy_no_cache $http_pragma $http_authorization;
proxy_pass_header Set-Cookie;
proxy_read_timeout 600;
proxy_redirect off;
proxy_send_timeout 600;
proxy_temp_file_write_size 64k;
proxy_set_header Accept-Encoding '';
proxy_set_header Cookie $http_cookie;
proxy_set_header Host $host;
proxy_set_header Proxy '';
proxy_set_header Referer $http_referer;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Original-Request $request_uri;
proxy_ssl_server_name on;

也将域设置为使用CloudFlare(与其他域一样),尽管CloudFlare已“暂停”,这意味着它仅用于DNS路由到服务器。服务器块也被符号链接到sites-active,并且与显示的错误相反,如果您访问该站点,则该站点实际上具有有效的HTTPS证书。我不确定是什么原因造成了502。

1 个答案:

答案 0 :(得分:0)

设法通过重新发行证书来解决此问题。虽然我是第一次尝试,但我没有意识到从目录/accounts/live/renewal中删除(据我所知)三个文件夹很重要。我没有这样做,这就是为什么我的续约无法正常工作的原因。

确保证书正确的最佳方法是确保/live包含证书,并且/renewal包含不为空的.conf。如果是上述任何一种情况,则证书可能没有正确部署,因此您应该查看一下是否错过了任何内容。