V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
beiyansideyu
V2EX  ›  问与答

我的网站 nginx 开启 https 后出现错误代码 ERR_CONNECTION_TIMED_OUT

  •  
  •   beiyansideyu · 2016-06-23 18:07:15 +08:00 · 14405 次点击
    这是一个创建于 3079 天前的主题,其中的信息可能已经有所发展或是发生改变。
    求大神们 搭救
    第 1 条附言  ·  2016-06-24 18:01:57 +08:00
    server {
    listen 80;

    server_name www.lostyou.love lostyou.love;
    root /home/wwwroot/lostyou.love;


    index index.html index.htm index.php;

    charset utf-8;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }



    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass //unix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTP_MOD_REWRITE On;
    fastcgi_intercept_errors off;

    fastcgi_connect_timeout 600;
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;

    }

    location ~ /\.ht {
    deny all;
    }
    }

    server {
    listen 443 ;
    ssl on;

    ssl_certificate /usr/local/nginx/conf/ssl/lostyou.love.crt;
    ssl_certificate_key /usr/local/nginx/conf/ssl/lostyou.love.key;
    server_name www.lostyou.love lostyou.love ;
    root /home/wwwroot/lostyou.love;


    index index.html index.htm index.php;

    charset utf-8;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }



    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass //unix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTP_MOD_REWRITE On;
    fastcgi_intercept_errors off;
    fastcgi_connect_timeout 600;
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;

    }

    location ~ /\.ht {
    deny all;
    }
    }
    18 条回复    2016-06-24 18:37:52 +08:00
    wql
        1
    wql  
       2016-06-23 18:45:23 +08:00 via Android
    iptables?
    chunchu
        2
    chunchu  
       2016-06-23 19:16:59 +08:00
    可能是 nginx 配置的问题,我自己的网页也出现这个错误,奇怪的是使用 Chrome 访问正常,使用 IE 、 Firefox 、 Safari 则提示 ERR_CONNECTION_TIMED_OUT 错误
    lslqtz
        3
    lslqtz  
       2016-06-23 19:17:51 +08:00 via iPhone
    问问题前先附配置。
    lhbc
        4
    lhbc  
       2016-06-23 19:42:08 +08:00
    这样提问我们也只能靠猜
    carpliyz
        5
    carpliyz  
       2016-06-23 20:02:19 +08:00 via iPhone   ❤️ 1
    @chunchu 难道是中间证书没有和网址证书串在一起?
    中间证书没有串进去,会导致这个问题
    chunchu
        6
    chunchu  
       2016-06-23 22:52:48 +08:00
    @carpliyz
    谢谢你的建议,我先试试看。
    dixyes
        7
    dixyes  
       2016-06-23 23:23:53 +08:00 via Android
    你应该在客户端 curl 你的服务网址( url ) -vvvv 并贴出结果
    在服务端 tail -n 50 /path/to/nginx/access.log 和 tail -n 50 /path/to/nginx/error.log 和 cat /path/to/nginx.conf 并贴出结果
    lslqtz
        8
    lslqtz  
       2016-06-24 07:15:39 +08:00 via iPhone
    @carpliyz 证书链不完整是报证书错误的。
    carpliyz
        9
    carpliyz  
       2016-06-24 08:15:32 +08:00 via iPhone
    @lslqtz 证书链不包括中间证书, chrome 可以过, firefox 过不了。我遇到过一次,也可能我其他配置出错😂
    lslqtz
        10
    lslqtz  
       2016-06-24 08:45:27 +08:00
    @carpliyz 6 ,那也是奇怪。我记得我 Firefox 有报证书错误,后面整张被吊销了。。
    beiyansideyu
        11
    beiyansideyu  
    OP
       2016-06-24 18:02:13 +08:00
    @lslqtz 附上了 SOS
    beiyansideyu
        12
    beiyansideyu  
    OP
       2016-06-24 18:03:49 +08:00
    @dixyes 71.6.165.200 - - [24/Jun/2016:10:29:36 +0800] "GET / HTTP/1.1" 200 2502 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
    71.6.165.200 - - [24/Jun/2016:10:29:36 +0800] "GET /robots.txt HTTP/1.1" 404 162 "-" "-"
    71.6.165.200 - - [24/Jun/2016:10:29:37 +0800] "GET /sitemap.xml HTTP/1.1" 404 162 "-" "-"
    91.200.12.98 - - [24/Jun/2016:11:02:29 +0800] "GET /home.php HTTP/1.0" 404 162 "http://zjrs.cc/home.php" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"
    91.200.12.98 - - [24/Jun/2016:11:02:30 +0800] "GET / HTTP/1.0" 200 2502 "http://zjrs.cc/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"
    157.55.39.195 - - [24/Jun/2016:11:05:57 +0800] "GET /robots.txt HTTP/1.1" 404 162 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
    157.55.39.195 - - [24/Jun/2016:11:06:00 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
    185.49.14.190 - - [24/Jun/2016:11:08:54 +0800] "GET http://testp4.pospr.waw.pl/testproxy.php HTTP/1.1" 404 162 "-" "Mozilla/5.0 (Windows NT 5.1; rv:32.0) Gecko/20100101 Firefox/31.0"
    62.210.170.165 - - [24/Jun/2016:11:26:50 +0800] "GET /robots.txt HTTP/1.0" 404 162 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    62.210.170.165 - - [24/Jun/2016:11:26:53 +0800] "GET / HTTP/1.0" 200 2502 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    66.249.75.222 - - [24/Jun/2016:11:41:28 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    66.249.75.132 - - [24/Jun/2016:12:09:18 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    37.208.66.211 - - [24/Jun/2016:13:22:39 +0800] "POST /blog/wp-content/uploads/2015/08/script.php HTTP/1.1" 404 162 "-" "-"
    37.208.66.211 - - [24/Jun/2016:13:23:29 +0800] "POST /blog/wp-content/uploads/2015/08/script.php HTTP/1.1" 404 162 "-" "-"
    123.125.71.41 - - [24/Jun/2016:13:45:00 +0800] "GET /thread-create-9.htm HTTP/1.1" 404 162 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
    66.249.69.150 - - [24/Jun/2016:13:54:43 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    66.249.75.172 - - [24/Jun/2016:14:01:03 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    151.248.116.4 - - [24/Jun/2016:14:04:01 +0800] "GET /home.php HTTP/1.0" 404 564 "http://npk-tehservice.ru" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36"
    151.248.116.4 - - [24/Jun/2016:14:04:01 +0800] "GET / HTTP/1.0" 200 2502 "http://zjrs.cc/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36"
    107.182.24.28 - - [24/Jun/2016:14:11:29 +0800] "GET /muieblackcat HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:30 +0800] "GET //phpMyAdmin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:30 +0800] "GET //phpmyadmin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:32 +0800] "GET //pma/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:33 +0800] "GET //myadmin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:35 +0800] "GET //MyAdmin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:38 +0800] "GET //mysql/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:40 +0800] "GET //mysqladmin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:41 +0800] "GET //scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:42 +0800] "GET //admin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    107.182.24.28 - - [24/Jun/2016:14:11:42 +0800] "GET //dbadmin/scripts/setup.php HTTP/1.1" 404 162 "-" "-"
    157.55.39.195 - - [24/Jun/2016:14:41:49 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
    66.249.75.140 - - [24/Jun/2016:15:24:43 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    66.249.66.140 - - [24/Jun/2016:15:24:44 +0800] "GET /robots.txt HTTP/1.1" 404 162 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    66.249.66.148 - - [24/Jun/2016:15:24:44 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    91.200.12.98 - - [24/Jun/2016:15:27:05 +0800] "GET /home.php HTTP/1.0" 404 564 "http://zjrs.cc/home.php" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"
    91.200.12.98 - - [24/Jun/2016:15:27:06 +0800] "GET / HTTP/1.0" 200 2502 "http://zjrs.cc/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"
    123.151.42.61 - - [24/Jun/2016:16:04:27 +0800] "GET http://www.baidu.com/ HTTP/1.1" 200 2502 "-" "-"
    66.249.75.222 - - [24/Jun/2016:16:04:42 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    169.229.3.91 - - [24/Jun/2016:16:45:36 +0800] "\xC64\xA0G9\xCB_\xB8i@\x8F\x8C\xED\x16\xF5'\xFF\xC2\xBE_\xA7\xAE\xCE\xB7t\xB8a=\x14$\x9B\xD3\xB3\xB2\x10\xBC\x7Fv\xCB\xDD\xF7\x12l\xD3Hg;\x80s" 400 166 "-" "-"
    46.246.53.139 - - [24/Jun/2016:17:22:18 +0800] "GET /forum.php HTTP/1.0" 404 162 "http://zjrs.cc/forum.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0"
    46.246.53.139 - - [24/Jun/2016:17:22:18 +0800] "GET / HTTP/1.0" 200 2502 "http://zjrs.cc/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0"
    91.121.101.78 - - [24/Jun/2016:17:24:10 +0800] "GET /robots.txt HTTP/1.0" 404 162 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    91.121.101.78 - - [24/Jun/2016:17:24:10 +0800] "GET /thread-3.htm HTTP/1.0" 404 162 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    91.121.101.78 - - [24/Jun/2016:17:24:12 +0800] "GET /thread-52.htm HTTP/1.0" 404 162 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    91.121.101.78 - - [24/Jun/2016:17:24:16 +0800] "GET /thread-54.htm HTTP/1.0" 404 162 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    91.121.101.78 - - [24/Jun/2016:17:24:17 +0800] "GET /thread-55.htm HTTP/1.0" 404 162 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)"
    66.249.75.132 - - [24/Jun/2016:17:28:03 +0800] "GET /robots.txt HTTP/1.1" 404 162 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    66.249.75.140 - - [24/Jun/2016:17:28:03 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    66.249.75.214 - - [24/Jun/2016:17:46:22 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
    220.181.108.157 - - [24/Jun/2016:18:05:20 +0800] "GET / HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
    beiyansideyu
        13
    beiyansideyu  
    OP
       2016-06-24 18:04:29 +08:00
    @dixyes 2016/06/24 17:55:57 [crit] 28994#0: *58 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 222.46.19.150, server: www.lostyou.love, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "lostyou.love", referrer: "http://lostyou.love/"
    beiyansideyu
        14
    beiyansideyu  
    OP
       2016-06-24 18:05:24 +08:00
    @dixyes user www www;

    worker_processes auto;

    error_log /home/wwwlogs/nginx_error.log crit;

    pid /usr/local/nginx/logs/nginx.pid;

    #Specifies the value for maximum file descriptors that can be opened by this process.
    worker_rlimit_nofile 51200;

    events
    {
    use epoll;
    worker_connections 51200;
    multi_accept on;
    }

    http
    {
    include mime.types;
    default_type application/octet-stream;

    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_max_body_size 50m;

    sendfile on;
    tcp_nopush on;

    keepalive_timeout 60;

    tcp_nodelay on;

    fastcgi_connect_timeout 600;
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;
    fastcgi_buffer_size 256k;
    fastcgi_buffers 8 256k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;

    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 2;
    gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
    gzip_vary on;
    gzip_proxied expired no-cache no-store private auth;
    gzip_disable "MSIE [1-6]\.";

    #limit_conn_zone $binary_remote_addr zone=perip:10m;
    ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

    server_tokens off;
    access_log off;

    server
    {
    listen 80 default_server;
    #listen [::]:80 default_server ipv6only=on;
    server_name www.lnmp.org;
    index index.html index.htm index.php;
    root /home/wwwroot/default;

    #error_page 404 /404.html;
    include enable-php.conf;

    location /nginx_status
    {
    stub_status on;
    access_log off;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
    expires 30d;
    }

    location ~ .*\.(js|css)?$
    {
    expires 12h;
    }

    location ~ /\.
    {
    deny all;
    }

    access_log /home/wwwlogs/access.log;
    }
    include vhost/*.conf;
    }
    lslqtz
        15
    lslqtz  
       2016-06-24 18:05:55 +08:00
    @beiyansideyu php 还是 ssl 算法的锅?
    dixyes
        16
    dixyes  
       2016-06-24 18:28:31 +08:00 via Android
    @beiyansideyu 不用专门 at 我 提供这些信息可以帮助有姿势的人帮你找错误
    beiyansideyu
        17
    beiyansideyu  
    OP
       2016-06-24 18:35:09 +08:00
    @lslqtz 之前一样 是 VPS 没问题。。现在 php 升级到 7 了 不过之前 5.4 也是一样 都是这样子
    beiyansideyu
        18
    beiyansideyu  
    OP
       2016-06-24 18:37:52 +08:00
    @dixyes 恩 tks
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5836 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 01:47 · PVG 09:47 · LAX 17:47 · JFK 20:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.