【发布时间】:2017-01-26 16:49:56
【问题描述】:
我有以下 NGINX 配置来将 https 重定向到 http,然后运行 301 重定向。问题是,如果人们访问 https://domain.com 而不是被重定向,他们就会卡在证书错误页面上。
server {
listen 443;
server_name domain.com www.domain.com;
rewrite ^(.*) http://$host$1 permanent;
}
server {
listen 80;
server_name domain.com www.domain.com;
location ~ /assets/img/images/(.*)$ {
return 301 https://domain.xyz/images/legacy/$1;
}
location ~ /frame/(.*)$ {
return 301 https://domain.xyz/embeded/$1;
}
}
【问题讨论】: