【问题标题】:NGINX SSL TimeoutNGINX SSL 超时
【发布时间】:2012-02-09 08:42:27
【问题描述】:

运行 NGINX SSL 并且浏览器继续超时。

这是我的 NGINX 配置文件:

worker_processes  4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
    use epoll;
}

http {
    proxy_next_upstream error;
    charset utf-8;
    include mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log;
    keepalive_timeout 65;
    keepalive_requests 0;
    proxy_read_timeout 200;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    gzip on;
    gzip_min_length 1000;
    gzip_proxied any;
    gzip_types text/plain text/css text/xml
               application/x-javascript application/xml
               application/atom+xml text/javascript;
    server{
            ### WEB Address ###
        server_name mydomain.com;


            ### SSL log files ###
            access_log /var/log/nginx/ssl-access.log;
    error_log /var/log/nginx/ssl-error.log;
    listen 443;

            ### SSL Certificates ###
    ssl on;
    ssl_certificate /etc/nginx/unified.crt;
    ssl_certificate_key /etc/nginx/ssl.key;
    keepalive_timeout    60;

            ### PROXY TO TORNADO ###
            location / {
        proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_pass http://127.0.0.1:8889;
        }
  }
}

SSL 访问日志和错误日志为空白。

我尝试过几次重启 NGINX。作为旁注,注释掉 SSL 并设置监听 80 适用于非 SSL 连接。

任何帮助都会很棒?

【问题讨论】:

    标签: ssl nginx


    【解决方案1】:

    首先我通过这个命令检查了端口 443 上监听的内容:

    lsof -iTCP -sTCP:LISTEN -P
    

    我看到 nginx 是正确的 然后我检查了443是否被klen提到的工具打开(http://www.yougetsignal.com/tools/open-ports/) 443 端口已关闭,所以我不得不运行

    iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
    

    打开443端口

    【讨论】:

      【解决方案2】:

      有几件事要检查

      #1:检查你的ubuntu服务器是否允许https

      sudo ufw allow https && sudo ufw enable
      

      #2:检查端口443是否打开

      【讨论】:

        【解决方案3】:

        我同意 Klen 的回答,我会补充更多。

        首先,检查你的 443 端口是否在http://www.yougetsignal.com/tools/open-ports/ 中打开

        如果它已关闭,请转到您的 aws 控制台,选择您的实例并转到描述 -> 安全组 -> launch_wizard-1

        然后点击编辑->添加规则

        从选项中选择 HTTPS,你应该会看到这个

        【讨论】:

          【解决方案4】:

          您的服务器上的 443 端口可能已关闭?用http://www.yougetsignal.com/tools/open-ports/检查这个

          【讨论】:

          • 我从没想过这会成为问题,你不知道你给我带来了多少快乐。非常感谢。
          • 谢谢,也帮助了我 :) Let's Encrypt 证书。
          • 伙伴..你救了我:)
          • 非常感谢,我检查了一下,我的 443 端口已关闭。你是如何打开它来解决这个问题的?
          • 我从lightsail 内部打开了色情内容,但也必须从console 打开它
          猜你喜欢
          • 2021-09-20
          • 2015-06-16
          • 2019-08-12
          • 2021-03-07
          • 1970-01-01
          • 2020-01-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多