嗨,能解释一下为什么吗https://www. 子域未重定向到https://non-www.sudomain
我正在运行nginx,似乎设置了所有重定向,但上面的一个似乎被Wordpress错误地重定向了,我有所有A记录,2个用于有无www的主域http版本,2个用于https记录。我的配置重定向如下。WordPress地址(URL)和网站地址(URL)设置为https://maindomain 不确定这是否是问题以及如何解决
#Main domain confing
server {
server_name domain.club;
access_log /var/www/bclub/logs/access.log;
error_log /var/www/bclub/logs/error.log;
root /var/www/bclub/;
index index.php index.html index.htm index.nginx-debian.html;
listen [::]:443 ssl http2; # managed by Certbot
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.club/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot
ssl_trusted_certificate /etc/letsencrypt/live/domain.club/chain.pem; # managed by Certbot
ssl_stapling on; # managed by Certbot
ssl_stapling_verify on; # managed by Certbot
}
server {
listen 80;
server_name domain.club www.domain.club;
return 301 https://domain.club$request_uri;
}
#SUB-domain confing
server {
server_name cdn.domain.club www.cdn.domain.club;
access_log /var/www/cdn.bclub/logs/access.log;
error_log /var/www/cdn.bclub/logs/error.log;
root /var/www/cdn.bclub;
index index.php index.html index.htm index.nginx-debian.html;
etag off;
listen 443 ssl http2; # managed by Certbot
listen [::]:443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.club/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot
ssl_trusted_certificate /etc/letsencrypt/live/domain.club/chain.pem; # managed by Certbot
ssl_stapling on; # managed by Certbot
ssl_stapling_verify on; # managed by Certbot
}
server {
listen 80;
server_name cdn.domain.club www.cdn.domain.club;
return 301 https://cdn.domain.club$request_uri;
}
非常感谢