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

请问一个 ssl 配置的问题

  •  
  •   baiduyixia · 2020-02-13 16:52:49 +08:00 · 652 次点击
    这是一个创建于 1551 天前的主题,其中的信息可能已经有所发展或是发生改变。

    站点配置了 https,然后百度抓取时候经常出现“抓取异常信息: socket 读写错误”,然后多抓取几次又成功,过段时间又复现,但是 http 并没有出错,所以怀疑是不是 ssl 配置出错,有人说 gzip 影响关闭了也无解,麻烦各位大佬指点一些,谢谢。 环境是军哥的 lnmp,证书使用的是阿里云申请的免费 Symantec 免费版,下面是配置文件信息

        listen 443 ssl http2;
        server_name test.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root /test;
    	
        ssl_certificate      /usr/local/nginx/conf/cert/test.pem;
        ssl_certificate_key  /usr/local/nginx/conf/cert/test.key;
        ssl_session_timeout 60m;
    	ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1 TLSv1;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_prefer_server_ciphers on;
        ssl_session_cache builtin:1000 shared:SSL:10m;
    
    
     include re/test_re.conf;
    
        error_page   404   /404.htm;
    
        include enable-php.conf;
    
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }
    
        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }
    
        location ~ /.well-known {
            allow all;
        }
    
        location ~ /\.
        {
            deny all;
        }
    
        access_log off;
    
    2 条回复    2020-02-13 22:30:00 +08:00
    baiduyixia
        1
    baiduyixia  
    OP
       2020-02-13 16:54:05 +08:00
    重新贴一下配置不知道为什么自动分了

    listen 443 ssl http2;
    server_name test.com;
    index index.html index.htm index.php default.html default.htm default.php;
    root /test;

    ssl_certificate /usr/local/nginx/conf/cert/test.pem;
    ssl_certificate_key /usr/local/nginx/conf/cert/test.key;
    ssl_session_timeout 60m;
    ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1 TLSv1;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_session_cache builtin:1000 shared:SSL:10m;


    include re/test_re.conf;

    error_page 404 /404.htm;

    include enable-php.conf;

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

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

    location ~ /.well-known {
    allow all;
    }

    location ~ /\.
    {
    deny all;
    }

    access_log off;
    baiduyixia
        2
    baiduyixia  
    OP
       2020-02-13 22:30:00 +08:00
    =.= 有大佬帮忙看一下吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1229 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:09 · PVG 07:09 · LAX 16:09 · JFK 19:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.