找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 135|回复: 11

【求帮助】nginx由https改回http主域名仍然自动跳转到https

[复制链接]

1

主题

24

回帖

75

积分

注册会员

积分
75
发表于 2017-11-17 15:30:52 | 显示全部楼层 |阅读模式
如题
之前用的https现在改回来了  相关301跳转和443端口配置均删除
但是浏览器输入主域名还是跳到https
但是加上/index.html就正常

配置已经精简到最小配置了
firefox chrome dege ie 都这样

nginx.conf

[ol]
  • user apache apache;
  • worker_processes auto;
  • #pid        logs/nginx.pid;
  • events {
  •     worker_connections  1024;
  •     use epoll;
  •     multi_accept on;
  • }
  • http {
  •     ### 日志处理 ###
  •     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  •                       '$status $body_bytes_sent "$http_referer" '
  •                       '"$http_user_agent" "$http_x_forwarded_for"';
  •     access_log off;
  •     ### 业务相关 ###
  •     include       mime.types;
  •     default_type text/html;
  •     charset utf-8;
  •     # gzip
  •     #include gzip.conf;
  •     # 缓存相关
  •     #引用waf配置
  •     include waf.conf;
  •     #引用网站配置
  •     include /opt/openresty/nginx/conf/abc.local;
  •    
  • }[/ol]复制代码

    abc.local

    [ol]
  • server {
  •   listen 80;
  •   server_name bbs.abc.cn;
  •   root /var/www/abc;
  •   index index.php index.html;
  •    if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
  •             set $year $1;
  •             set $month $2;
  •             set $day $3;
  •     }
  •     access_log /opt/openresty/nginx/logs/$year-$month-$day-findbbs-access123.log;
  •     error_log /opt/openresty/nginx/logs/abc-error123.log;
  • }[/ol]复制代码
  • 回复

    使用道具 举报

    591

    主题

    4355

    回帖

    1万

    积分

    论坛元老

    积分
    10535
    发表于 2017-11-17 15:55:18 | 显示全部楼层
    把站删了吧,好好上班。
    回复

    使用道具 举报

    42

    主题

    1456

    回帖

    3158

    积分

    论坛元老

    积分
    3158
    发表于 2017-11-17 15:34:08 | 显示全部楼层
    之前配置了HSTS了吧
    回复

    使用道具 举报

    97

    主题

    871

    回帖

    2101

    积分

    金牌会员

    积分
    2101
    发表于 2017-11-17 15:41:28 | 显示全部楼层


    配置了hsts 在浏览器有记录 浏览器会强制使用https
    回复

    使用道具 举报

    1

    主题

    24

    回帖

    75

    积分

    注册会员

    积分
    75
     楼主| 发表于 2017-11-17 15:43:12 | 显示全部楼层

    darksheen 发表于 2017-11-17 15:34

    之前配置了HSTS了吧


    之前用的github现成的配置  我再检查一遍
    回复

    使用道具 举报

    1

    主题

    24

    回帖

    75

    积分

    注册会员

    积分
    75
     楼主| 发表于 2017-11-17 15:34:00 | 显示全部楼层
    有相关配置  但是默认是注释掉的 我没有开启也。我查下有什么方法清除一下。谢谢各位了!
    [ol]
  • # HSTS (HTTP Strict Transport Security)
  • # This header tells browsers to cache the certificate for a year and to connect exclusively via HTTPS.
  • #add_header Strict-Transport-Security "max-age=31536000;" always;
  • # This version tells browsers to treat all subdomains the same as this site and to load exclusively over HTTPS
  • #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;" always;
  • # This version tells browsers to treat all subdomains the same as this site and to load exclusively over HTTPS
  • # Recommend is also to use preload service
  • #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" always;[/ol]复制代码
  • 回复

    使用道具 举报

    1

    主题

    24

    回帖

    75

    积分

    注册会员

    积分
    75
     楼主| 发表于 2017-11-17 15:49:12 | 显示全部楼层
    本帖最后由 大华影院 于 2017-11-17 15:55 编辑






    清除了问题依旧。。。。

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    ×
    回复

    使用道具 举报

    8

    主题

    999

    回帖

    2068

    积分

    金牌会员

    积分
    2068
    发表于 2017-11-17 15:54:16 | 显示全部楼层
    清浏览器缓存,用隐身窗口打开。
    回复

    使用道具 举报

    1

    主题

    24

    回帖

    75

    积分

    注册会员

    积分
    75
     楼主| 发表于 2017-11-17 15:57:57 | 显示全部楼层

    冻猫 发表于 2017-11-17 15:57

    清浏览器缓存,用隐身窗口打开。

    就是一直隐身窗口,缓存也全部清了。。。
    回复

    使用道具 举报

    0

    主题

    1

    回帖

    4

    积分

    新手上路

    积分
    4
    发表于 2017-11-17 16:06:24 | 显示全部楼层
    https不挺好, 全站上https的路过你配置个新站试试会不会跳转,看看DNS那里是不是设置了什么规则。
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-8-8 19:38 , Processed in 0.023751 second(s), 4 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2025 Discuz! Team.

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