莫北恋 发表于 2021-5-15 12:03:05

Windows面板网站需要带端口访问,一旦开启https网站就打不...

server
{
    listen 2021;
        listen 443 ssl;
    server_name ****ric2.top;
    index index.php index.html index.htm default.php default.htm default.html;
    root K:/kuodaoyun;
               
        #START-ERROR-PAGE
        #error_page 403 /403.html;
        error_page 404 /404.html;
    #error_page 502 /502.html;
        #END-ERROR-PAGE
   
    #HTTP_TO_HTTPS_START
    if ($server_port !~ 443){
      rewrite ^(/.*)$ https://$host$1 permanent;
    }
    #HTTP_TO_HTTPS_END

    #LIMIT_INFO_START
    #LIMIT_INFO_END

    #SSL-INFO-START
    ssl_certificate    ssl/****ric2.top/fullchain.pem;
    ssl_certificate_key    ssl/****ric2.top/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497https://$host$request_uri;
    #SSL-INFO-END
      
    #反代清理缓存配置
    location ~ /purge(/.*) {
      proxy_cache_purge cache_one $1$is_args$args;
    }
    #proxy 反向代理
    include proxy/***ric2.top/*.conf;

    #PHP-INFO-START
    include php/73.conf;
    #PHP-INFO-END
   
    #REWRITE-START
    include rewrite/***ric2.top/*.conf;
    #REWRITE-END

    #redirect 重定向
    include redirect/***ric2.top/*.conf;

    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
      return 404;
    }
   
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
      allow all;
    }

        access_logJ:/BtSoft/wwwlogs/***ric2.top.log;
    error_logJ:/BtSoft/wwwlogs/***ric2.top.error.log;
}

莫北恋 发表于 2021-5-15 12:04:23

家里的NAS,80和443端口肯定是被封了,有外网IP。感觉是这个配置没写对,有懂的大佬帮忙看看嘛?从昨天一直折腾到现在,我基本确定就是这里的配置问题了。
页: [1]
查看完整版本: Windows面板网站需要带端口访问,一旦开启https网站就打不...