关于ssl的问题
网站带www的上了ssl,然后子域名或者不带www的只要上ssl都会默认跳到带www的页面去,为什么?例如 https://www.1.com
然后添加https://1.com或者https://1.1.com都会跑到https://www.1.com
前部分规则如下:
server
{
if ($server_port = 80) {
return 301 https://$server_name$request_uri;
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
error_page 497 https://$server_name$request_uri;
listen 80;
listen 443 ssl spdy;
server_name www.1.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/www.1.com;
ssl on;
ssl_certificate /usr/local/nginx/conf/1_www.1.com_bundle.crt;
ssl_certificate_key /usr/local/nginx/conf/2_www.1.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RC4-SHA:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!DSS:!PKS;
ssl_session_cache builtin:1000 shared:SSL:10m;
include wordpress.conf; 因为你的程序是wordpress,它就自带301
页:
[1]