全球主机交流论坛

标题: 【求帮助】nginx由https改回http主域名仍然自动跳转到https [打印本页]

作者: 大华影院    时间: 2017-11-17 15:30
标题: 【求帮助】nginx由https改回http主域名仍然自动跳转到https
如题
之前用的https现在改回来了  相关301跳转和443端口配置均删除
但是浏览器输入主域名还是跳到https
但是加上/index.html就正常

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

nginx.conf

  1. user apache apache;
  2. worker_processes auto;


  3. #pid        logs/nginx.pid;


  4. events {
  5.     worker_connections  1024;
  6.     use epoll;
  7.     multi_accept on;
  8. }


  9. http {
  10.     ### 日志处理 ###
  11.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  12.                       '$status $body_bytes_sent "$http_referer" '
  13.                       '"$http_user_agent" "$http_x_forwarded_for"';
  14.     access_log off;

  15.     ### 业务相关 ###
  16.     include       mime.types;
  17.     default_type text/html;
  18.     charset utf-8;


  19.     # gzip
  20.     #include gzip.conf;

  21.     # 缓存相关

  22.     #引用waf配置
  23.     include waf.conf;

  24.     #引用网站配置
  25.     include /opt/openresty/nginx/conf/abc.local;


  26.    

  27. }
复制代码


abc.local

  1. server {
  2.   listen 80;
  3.   server_name bbs.abc.cn;
  4.   root /var/www/abc;
  5.   index index.php index.html;
  6.    if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
  7.             set $year $1;
  8.             set $month $2;
  9.             set $day $3;
  10.     }
  11.     access_log /opt/openresty/nginx/logs/$year-$month-$day-findbbs-access123.log;
  12.     error_log /opt/openresty/nginx/logs/abc-error123.log;
  13. }
复制代码


作者: darksheen    时间: 2017-11-17 15:34
之前配置了HSTS了吧
作者: haohaoge    时间: 2017-11-17 15:41
配置了hsts 在浏览器有记录 浏览器会强制使用https
作者: 大华影院    时间: 2017-11-17 15:43
darksheen 发表于 2017-11-17 15:34
之前配置了HSTS了吧


之前用的github现成的配置  我再检查一遍
作者: 大华影院    时间: 2017-11-17 15:49
有相关配置  但是默认是注释掉的 我没有开启也。我查下有什么方法清除一下。谢谢各位了!
  1. # HSTS (HTTP Strict Transport Security)
  2. # This header tells browsers to cache the certificate for a year and to connect exclusively via HTTPS.
  3. #add_header Strict-Transport-Security "max-age=31536000;" always;
  4. # This version tells browsers to treat all subdomains the same as this site and to load exclusively over HTTPS
  5. #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;" always;
  6. # This version tells browsers to treat all subdomains the same as this site and to load exclusively over HTTPS
  7. # Recommend is also to use preload service
  8. #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" always;
复制代码

作者: 大华影院    时间: 2017-11-17 15:54
本帖最后由 大华影院 于 2017-11-17 15:55 编辑


(, 下载次数: 1)

清除了问题依旧。。。。
作者: leaveoff    时间: 2017-11-17 15:55
把站删了吧,好好上班。
作者: 冻猫    时间: 2017-11-17 15:57
清浏览器缓存,用隐身窗口打开。
作者: 大华影院    时间: 2017-11-17 16:06
冻猫 发表于 2017-11-17 15:57
清浏览器缓存,用隐身窗口打开。

就是一直隐身窗口,缓存也全部清了。。。
作者: benjiam    时间: 2017-11-17 16:09
https不挺好, 全站上https的路过
作者: 冻猫    时间: 2017-11-17 16:10
你配置个新站试试会不会跳转,看看DNS那里是不是设置了什么规则。
作者: asdqwe876    时间: 2017-11-17 16:43
用ie测试,勾选自动删除缓存。chrome会对这类东西自动缓存的
作者: aumfoo    时间: 2017-11-17 16:44
浏览器。。。




欢迎光临 全球主机交流论坛 (https://loc.998820.xyz/) Powered by Discuz! X3.4