我对 nginx 还不是很熟悉,我正在尝试解决一个问题。我有一个网站,我可以通过 https 毫无问题地访问它。但是,当我尝试从其他网络访问它时,它却无法正常工作。我收到“无法访问此站点的错误消息”这可能是网络问题,但是我可以毫无问题地 ping 服务器,并且可以毫无问题地 telnet 到端口 80 和 443。在 nginx 服务器上,我使用 tcpdump 查看连接是否一直连接到服务器,结果是可以的。我将 tcpdump 与一个正常工作的位置进行了比较,似乎 Web 服务器从不起作用的位置接收到了一个空字符串。即使我将日志记录级别设置为调试,我也看不到 error.log 文件下的任何相关内容。access.log 文件仅记录来自正常工作的位置的尝试。
我在网上看到有一种方法可以从空请求中获取 access.log 数据,但这对我来说不起作用。当我重新启动 nginx 时,它无法启动。这是我找到此信息的链接: nginx 访问日志忽略某些请求
我想如果我能记录请求,它就会让我更好地了解正在发生的事情。
任何有关此问题的帮助都将不胜感激。谢谢
NGINX 从未识别过 TCP DUMP HTTPS 请求
07:28:10.232407 IP 10.XX.XXX.XXX.63053 > mira-lb.local.https: Flags [S], seq 1918828503, win 64240, options [mss 1460,nop,wscale8,nop,nop,sackOK],**length 0**
07:28:10.232458 IP mira-lb.local.https > 10.XX.XXX.XXX.63053: Flags [S.], seq 1433909711, ack 1918828504, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
07:28:10.232483 IP 10.XX.XXX.XXX.63054 > mira-lb.local.https: Flags [S], seq 1331643201, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
07:28:10.232531 IP mira-lb.local.https > 10.XX.XXX.XXX.63054: Flags [S.], seq 2346320018, ack 1331643202, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
07:28:10.232817 IP 10.XX.XXX.XXX.63053 > mira-lb.local.https: Flags [.], ack 1, win 2053, length 0
07:28:10.232848 IP 10.XX.XXX.XXX.63054 > mira-lb.local.https: Flags [.], ack 1, win 2053, length 0
07:28:10.232977 IP 10.XX.XXX.XXX.63054 > mira-lb.local.https: Flags [P.], seq 1:218, ack 1, win 2053, length 217
07:28:10.233003 IP mira-lb.local.https > 10.XX.XXX.XXX.63054: Flags [.], ack 218, win 237, length 0
07:28:10.233056 IP 10.XX.XXX.XXX.63053 > mira-lb.local.https: Flags [P.], seq 1:218, ack 1, win 2053, length 217
07:28:10.233076 IP mira-lb.local.https > 10.XX.XXX.XXX.63053: Flags [.], ack 218, win 237, length 0
07:28:10.236559 IP mira-lb.local.https > 10.XX.XXX.XXX.63054: Flags [P.], seq 1:5591, ack 218, win 237, length 5590
07:28:10.236885 IP 10.XX.XXX.XXX.63054 > mira-lb.local.https: Flags [.], ack 1, win 2053, options [nop,nop,sack 1 {4381:5591}], length 0
07:28:10.236915 IP mira-lb.local.https > 10.XX.XXX.XXX.63054: Flags [.], seq 1:1461, ack 218, win 237, length 1460
07:28:10.238628 IP mira-lb.local.https > 10.XX.XXX.XXX.63053: Flags [P.], seq 1:5591, ack 218, win 237, length 5590
07:28:10.238961 IP 10.XX.XXX.XXX.63053 > mira-lb.local.https: Flags [.], ack 1, win 2053, options [nop,nop,sack 1 {4381:5591}], length 0
07:28:10.238994 IP mira-lb.local.https > 10.XX.XXX.XXX.63053: Flags [.], seq 1:1461, ack 218, win 237, length 1460
07:28:10.439523 IP mira-lb.local.https > 10.XX.XXX.XXX.63053: Flags [.], seq 1:1461, ack 218, win 237, length 1460
HTTPS 请求正常运行
09:08:13.088028 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [P.], seq 116250704:116251547, ack 1890870853, win 512, **length 843**
09:08:13.088065 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [.], ack 843, win 311, length 0
09:08:13.088071 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [P.], seq 843:889, ack 1, win 512, length 46
09:08:13.088078 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [.], ack 889, win 311, length 0
09:08:13.088359 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [P.], seq 1:47, ack 889, win 311, length 46
09:08:13.092010 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [P.], seq 47:2210, ack 889, win 311, length 2163
09:08:13.146358 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 47, win 16383, length 0
09:08:13.168708 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 47, win 16383, options [nop,nop,sack 1 {1413:2210}], length 0
09:08:13.194117 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 47, win 16384, options [nop,nop,sack 1 {1413:2210}], length 0
09:08:13.281878 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 2210, win 16375, length 0
09:08:13.311027 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 2210, win 16384, length 0
09:08:13.342792 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [P.], seq 889:985, ack 2210, win 16384, length 96
09:08:13.344140 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [P.], seq 2210:2994, ack 985, win 311, length 784
09:08:13.410820 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 2994, win 16380, length 0
09:08:13.448558 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 2994, win 16384, length 0
09:08:18.404894 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [P.], seq 985:1826, ack 2994, win 509, length 841
09:08:18.430867 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [P.], seq 2994:5158, ack 1826, win 329, length 2164
09:08:18.514749 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 2994, win 16384, options [nop,nop,sack 1 {4360:5158}], length 0
09:08:18.514775 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 5158, win 16384, length 0
09:08:18.543209 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [P.], seq 1826:2061, ack 5158, win 16384, length 235
09:08:18.544684 IP mira-lb.local.https > 10.AA.AAA.AAA.56031: Flags [P.], seq 5158:5942, ack 2061, win 347, length 784
09:08:18.613012 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 5942, win 16380, length 0
09:08:18.657856 IP 10.AA.AAA.AAA.56031 > mira-lb.local.https: Flags [.], ack 5942, win 16384, length 0