情况是这样的,无论输入下列哪种情况,都希望跳转到 bcd456.com
应该怎么写啊
http://www.abc123.com
http://123213.abc123.com
http://abc123.com
http://www.abc123.com/3232d
http://123213.abc123.com/3232d
http://abc123.com/3232d
https://www.abc123.com
https://123213.abc123.com
https://abc123.com
https://www.abc123.com/3232d
https://123213.abc123.com/3232d
https://abc123.com/3232d
原来是这样配置的,但是这两个不行
https://www.abc123.com
https://123213.abc123.com
https://www.abc123.com/3232d
https://123213.abc123.com/3232d
server
{
listen 80;
server_name abc123.com www.abc123.com *.abc123.com;
location / {
rewrite ^/(.*) https://abc123.com/$1 permanent;
}
}
server {
server_name abc123.com;
listen 443;
ssl on;
ssl_certificate /etc/letsencrypt/m/fullchain.pem;
ssl_certificate_key /etc/letsencryp/privkey.pem;
return 301 http://bcd456.com$request_uri;
}server
{
listen 80;
server_name abc123.com www.abc123.com *.abc123.com;
location / {
rewrite ^/(.*) https://abc123.com/$1 permanent;
}
}
server {
server_name abc123.com;
listen 443;
ssl on;
ssl_certificate /etc/letsencrypt/m/fullchain.pem;
ssl_certificate_key /etc/letsencryp/privkey.pem;
return 301 http://bcd456.com$request_uri;
}
后来申请了泛域名配置改成如下,发现只有这 4 个可以跳转
https://www.abc123.com
https://123213.abc123.com
https://www.abc123.com/3232d
https://123213.abc123.com/3232d
server
{
listen 80;
server_name abc123.com www.abc123.com *.abc123.com;
location / {
rewrite ^/(.*) https://abc123.com/$1 permanent;
}
}
server {
server_name abc123.com www.abc123.com *.abc123.com;
listen 443;
ssl on;
ssl_certificate /etc/letsencrypt/m/fullchain.pem;
ssl_certificate_key /etc/letsencryp/privkey.pem;
return 301 http://bcd456.com$request_uri;
}