我的nginxconfiguration有两个redirect规则:
HTTP到HTTPS
if ($http_x_forwarded_proto = "http") { return 301 https://$server_name$request_uri; }
WWW到非WWW
server_name www.alphainvesting.co.il; return 301 https://alphainvesting.co.il$request_uri;
除非用户访问http://www.alphainvesting.co.il ,否则一切都很好。 然后他们被redirect到https://alphainvesting.co.il/ *(当然返回404错误)。
值得一提的是我正在使用Cloudflare,但是我没有页面规则。
尝试使用$uri而不是$request_uri来移除www