在使用duckduckgo 数小时后,这是我得出的最佳答案,但仍无法将当前的HTTPS 域重定向到新的HTTPS 域。
server {
listen 80;
listen 443 ssl;
server_name www.olddomain.com olddomain.com;
rewrite 301 https://newdomain.com$request_uri;
}
浏览器给出不安全的连接错误。
我也尝试过类似的东西
server {
listen 443 ssl;
server_name olddomain.com;
ssl on;
ssl_certificate /etc/ssl/certs/OLD.crt;
ssl_certificate_key /etc/ssl/private/OLD.key;
#enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated.
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "ALLLLLLTTHHISSSS";
ssl_prefer_server_ciphers on;
rewrite 301 https://newdomain.com$request_uri;
}
尽管此选项停止给出错误,但重写不起作用,它会转到“欢迎使用 NGINX 页面”。