301跳转 https_为啥https会自动301跳转到http?

有个站点,刚刚成功的安装了 Let’s Encrypt 的免费证书,nginx已经配置了关于https的访问。

现在可以通过 https 和 http 两种方式访问了,有些页面两种方式都可以访问,但是部分页面通过https访问竟然会 301 跳转到 http 页面地址,例如:

这是为什么呢?请各位大神各抒己见,多谢!

nginx 配置如下:

server {

listen 80;

server_name www.phpernote.com ;

root /home/xxx/xxx;

location / {

index index.php index.html;

}

include /home/xxx/xxx/.htaccess;

location ~ ^(?:(?

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

include fastcgi_params;

}

}

server {

listen 80;

server_name phpernote.com ;

root /home/xxx/xxx;

location / {

index index.php index.html;

}

include /home/xxx/xxx/.htaccess;

location ~ ^(?:(?

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

include fastcgi_params;

}

}

server {

listen 443 ssl;

ssl on;

ssl_certificate /etc/letsencrypt/live/www.phpernote.com/fullchain.pem;

ssl_certificate_key /etc/letsencrypt/live/www.phpernote.com/privkey.pem;

server_name www.phpernote.com ;

root /home/xxx/xxx;

location / {

index index.php index.html;

}

include /home/xxx/xxx/.htaccess;

location ~ ^(?:(?

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

include fastcgi_params;

}

}


版权声明:本文为weixin_39588252原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。