大网数据广告活动
服务器运维问答

Nginx setup, 443 open but no respons on https://

· 52CE 我爱测

So i just integrated my certificate and my nginx conf verifies it when i restart. When i do a: netstat -anp | grep 443 it returns: tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 22241/nginx But when i try to reach it on the browser it just…

问题原文

原帖链接 · Simon Dragsbæk · CC BY-SA 3.0

So i just integrated my certificate and my nginx conf verifies it when i restart. When i do a:

netstat -anp | grep 443

it returns:

tcp      0      0 0.0.0.0:443       0.0.0.0:*          LISTEN      22241/nginx

But when i try to reach it on the browser it just times out.

My nginx conf is:

http {
    server_names_hash_bucket_size 64;

    server {
        listen 80;
        listen 443 ssl;

        fastcgi_param HTTPS on;

        server_name www.example.com example.com;

        ssl on;
        ssl_certificate /root/ssl/example_com/example.com.chained.crt;
        ssl_certificate_key /root/ssl/example_com/example.com.key;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

        #rewrite ^/(.*) https://example.com/$1 permanent;

        location / {
            # Works on port 80....
        }
    }
}
events { 
    worker_connections  1024; 
}

Besides that iv'd setup ufw on my server where i opened up port 22, 80 and 443.

TCP DUMP

14:43:33.951775 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 216993490 ecr 0,sackOK,eol], length 0
14:43:34.980760 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 216994490 ecr 0,sackOK,eol], length 0
14:43:36.052331 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 216995490 ecr 0,sackOK,eol], length 0
14:43:37.101006 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 216996490 ecr 0,sackOK,eol], length 0
14:43:38.140117 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 216997490 ecr 0,sackOK,eol], length 0
14:43:39.210849 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 216998491 ecr 0,sackOK,eol], length 0
14:43:40.688591 IP LOCALIP.54653 > HOSTIP.443: Flags [S], seq 743769181, win 65535, options [mss 1460,sackOK,eol], length 0
14:43:41.311110 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 217000492 ecr 0,sackOK,eol], length 0
14:43:43.368351 IP LOCALIP.54660 > HOSTIP.443: Flags [S], seq 797790670, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 217002440 ecr 0,sackOK,eol], length 0
14:43:43.419444 IP LOCALIP.54661 > HOSTIP.443: Flags [S], seq 2577678109, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 217002490 ecr 0,sackOK,eol], length 0
14:43:45.534502 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 217004492 ecr 0,sackOK,eol], length 0
14:43:53.981084 IP LOCALIP.54664 > HOSTIP.443: Flags [S], seq 3123601024, win 65535, options [mss 1460,nop,wscale 5,nop,nop,TS val 217012492 ecr 0,sackOK,eol], length 0

What could it be?

已采纳解答

原帖链接 · user1700494 · CC BY-SA 3.0

In ordert to find out whether packets are really reaching you server, run

tcpdump -ni <outer network interface> host <IP of remote client> and port 443

For example:

tcpdump -ni eth0 host 12.34.56.78 and port 443

If you see the packets, then something is wrong with your firewall.
If not, then you have connectivity issues between your client and webserver.
To solve this out you may run on client:
tracert <webserver's IP> (on Windows)
or
traceroute <webserver's IP> (on Unix)
save output to file and call your ISP/network administrator/someone else who cares. They will probably ask for trace - you have it saved in file.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。