宝塔51特惠活动,企业版1099元/年,送SSL证书,最高立减2万元!查看活动
当前位置:论坛首页 > Windows面板 > 求助

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

发表在 Windows面板2021-5-15 12:03 [复制链接] 1 5712

  1. server
  2. {
  3.     listen 2021;
  4.         listen 443 ssl;
  5.     server_name ****ric2.top;
  6.     index index.php index.html index.htm default.php default.htm default.html;
  7.     root K:/kuodaoyun;
  8.                
  9.         #START-ERROR-PAGE
  10.         #error_page 403 /403.html;
  11.         error_page 404 /404.html;
  12.     #error_page 502 /502.html;
  13.         #END-ERROR-PAGE
  14.    
  15.     #HTTP_TO_HTTPS_START
  16.     if ($server_port !~ 443){
  17.         rewrite ^(/.*)$ https://$host$1 permanent;
  18.     }
  19.     #HTTP_TO_HTTPS_END

  20.     #LIMIT_INFO_START
  21.     #LIMIT_INFO_END

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

  39.     #PHP-INFO-START
  40.     include php/73.conf;
  41.     #PHP-INFO-END
  42.    
  43.     #REWRITE-START
  44.     include rewrite/***ric2.top/*.conf;
  45.     #REWRITE-END

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

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

  58.         access_log  J:/BtSoft/wwwlogs/***ric2.top.log;
  59.     error_log  J:/BtSoft/wwwlogs/***ric2.top.error.log;
  60. }
复制代码


使用道具 举报 只看该作者 回复
发表于 2021-5-15 12:04:23 | 显示全部楼层
家里的NAS,80和443端口肯定是被封了,有外网IP。感觉是这个配置没写对,有懂的大佬帮忙看看嘛?从昨天一直折腾到现在,我基本确定就是这里的配置问题了。
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析
快速回复 返回顶部 返回列表