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

如何强制https!

发表在 Linux面板2017-6-29 17:17 [复制链接] 20 8026

我的域名roo.ooo只有https能正常访问。http被拦截!请问如何强制https?
使用道具 举报 只看该作者 回复
发表于 2017-6-29 17:34:53 | 显示全部楼层
nginx还是apache?
使用道具 举报 回复 支持 反对
发表于 2017-6-29 19:26:37 | 显示全部楼层
有的网站程序就可以设置网址为https,面板没有发现这个功能
使用道具 举报 回复 支持 反对
发表于 2017-6-29 19:28:42 | 显示全部楼层

nginx  
使用道具 举报 回复 支持 反对
发表于 2017-6-29 19:29:04 | 显示全部楼层

nginx  
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:00:48 | 显示全部楼层

配置文件参考如下代码:
  1. server
  2. {
  3.     listen 80;
  4.         listen 443 ssl;
  5.     server_name birdteam.net www.birdteam.net;
  6.     index index.php index.html index.htm default.php default.htm default.html;
  7.     root /www/wwwroot/birdteam.net;
  8.     #error_page 404/404.html;
  9.     ssl_certificate    /etc/letsencrypt/live/birdteam.net/fullchain.pem;
  10.     ssl_certificate_key    /etc/letsencrypt/live/birdteam.net/privkey.pem;
  11.    <font color="#ff0000"> if ($server_port !~ 443){
  12.         rewrite ^/.*$ https://$host$request_uri permanent;
  13.     }</font>
  14.     error_page 497  https://$host$request_uri;

  15.     error_page 404 /404.html;
  16.     error_page 502 /502.html;
  17.    
  18.     include enable-php-54.conf;
  19.     include /www/server/panel/vhost/rewrite/birdteam.net.conf;
  20.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  21.     {
  22.         expires      30d;
  23.         access_log off;
  24.     }
  25.     location ~ .*\.(js|css)?$
  26.     {
  27.         expires      12h;
  28.         access_log off;
  29.     }
  30.     access_log  /www/wwwlogs/birdteam.net.log;
  31. }
复制代码

如果你不会改,也可以贴出来,我帮你改!
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:06:46 | 显示全部楼层
server
{
    listen 80 default_server;
        listen 443 ssl default_server;
    server_name soolo.cn roo.ooo;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/soolo.cn;
    #error_page 404/404.html;
    ssl_certificate    /etc/letsencrypt/live/soolo.cn/fullchain.pem;
    ssl_certificate_key    /etc/letsencrypt/live/soolo.cn/privkey.pem;
    if ($server_port !~ 443){
        rewrite ^/.*$ https://$host$request_uri permanent;
    }
    error_page 497  https://$host$request_uri;



    error_page 404 /404.html;
    error_page 502 /502.html;

    include enable-php-71.conf;
    include /www/server/panel/vhost/rewrite/soolo.cn.conf;
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        access_log off;
    }
    location ~ .*\.(js|css)?$
    {
        expires      12h;
        access_log off;
    }
    access_log  off;
}

使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:07:21 | 显示全部楼层
  1. server
  2. {
  3.     listen 80 default_server;
  4.         listen 443 ssl default_server;
  5.     server_name soolo.cn roo.ooo;
  6.     index index.php index.html index.htm default.php default.htm default.html;
  7.     root /www/wwwroot/soolo.cn;
  8.     #error_page 404/404.html;
  9.     ssl_certificate    /etc/letsencrypt/live/soolo.cn/fullchain.pem;
  10.     ssl_certificate_key    /etc/letsencrypt/live/soolo.cn/privkey.pem;
  11.     if ($server_port !~ 443){
  12.         rewrite ^/.*$ https://$host$request_uri permanent;
  13.     }
  14.     error_page 497  https://$host$request_uri;



  15.     error_page 404 /404.html;
  16.     error_page 502 /502.html;
  17.    
  18.     include enable-php-71.conf;
  19.     include /www/server/panel/vhost/rewrite/soolo.cn.conf;
  20.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  21.     {
  22.         expires      30d;
  23.         access_log off;
  24.     }
  25.     location ~ .*\.(js|css)?$
  26.     {
  27.         expires      12h;
  28.         access_log off;
  29.     }
  30.     access_log  off;
  31. }
复制代码


使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:09:14 | 显示全部楼层
penn 发表于 2017-6-29 20:00
配置文件参考如下代码:

如果你不会改,也可以贴出来,我帮你改!

l楼上贴了
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:24:48 | 显示全部楼层

可以啊没错啊,我去你的网站看了,是强制https!
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:27:04 | 显示全部楼层
penn 发表于 2017-6-29 20:24
可以啊没错啊,我去你的网站看了,是强制https!

有些浏览器就是不能https,比如猎豹和IE
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:28:15 | 显示全部楼层
penn 发表于 2017-6-29 20:24
可以啊没错啊,我去你的网站看了,是强制https!

使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:28:46 | 显示全部楼层
这是猎豹的
QQ图片20170629202713.png
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:29:46 | 显示全部楼层
忙鹿鹿 发表于 2017-6-29 20:27
有些浏览器就是不能https,比如猎豹和IE

配置文件没有问题!
使用道具 举报 回复 支持 反对
发表于 2017-6-29 20:33:30 | 显示全部楼层

服务商会有域名验证的,当你的域名没备案,就会显示这种界面!
使用道具 举报 回复 支持 反对
12下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

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

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

紧急运维服务

响应时间:3分钟

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

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

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

立即付费处理

工作时间:09:00至24:00

快速回复 返回顶部 返回列表