我的所有站点都返回301响应代码,而不是200。我的站点托管在amazon上,我的dns由cloudflare管理。我正在使用来自云耀斑的免费ssl。
我在第三方网站上测试我的网站。似乎我在任何地方都会犯以下错误:
Your server did not return a valid HTTP code (You returned 301 when you should have returned 200).我的服务器是使用nginx配置的。这是我的nginx服务器代码:
server {
listen 80;
listen 443 ssl;
root /media/6sense/www/shajao.com;
index index.html index.htm index.nginx-debian.html;
server_name shajao.com www.shajao.com;
location / {
try_files $uri$args $uri$args/ /index.html;
}
}这是我的网站。https://shajao.com/
发布于 2018-08-15 23:28:42
当通过HTTP请求时,站点返回301,以便重定向到HTTPS。也就是说,如果有人试图获取http://shajao.com,就会得到301号重定向到https://shajao.com。这是一件好事:每个人都应该使用HTTPS而不是HTTP。如果你告诉那些第三方网站使用HTTPS,它应该工作-确保键入您的网站网址从https://开始。尽管如此,如果您确实希望允许通过HTTP进行通信,则可以在Cloudflare设置中关闭“始终使用HTTPS”选项。
https://stackoverflow.com/questions/51854130
复制相似问题