Redirect 在nginx中撤消将http重定向到https

Redirect 在nginx中撤消将http重定向到https,redirect,nginx,Redirect,Nginx,我不得不将http重定向到https,用于subdomain.domain.com,所以我重写了^(.*)https://$server\u name$request\u uri?永久的在nginx.conf中。永久参数使客户端浏览器始终重定向到https。现在我想要的是删除https重定向。因此subdomain.domain.com将重定向到http://subdomain.domain.com。但是客户端浏览器设置为始终重定向到https,并且他们无法访问http://subdomain.

我不得不将http重定向到https,用于
subdomain.domain.com
,所以我重写了^(.*)https://$server\u name$request\u uri?永久的
nginx.conf
中。
永久
参数使客户端浏览器始终重定向到
https
。现在我想要的是删除
https
重定向。因此
subdomain.domain.com
将重定向到
http://subdomain.domain.com
。但是客户端浏览器设置为始终重定向到https,并且他们无法访问
http://subdomain.domain.com
因为它被重定向到
https://subdomain.domain.com
。如何解决这个问题?

永久的
所做的就是决定是发送301还是302响应。大多数浏览器都会在缓存过期时删除它。@Basic,但客户端在chrome的“匿名”窗口中打开url,它仍然会重定向到httpsIf。如果我让客户端清除缓存内容,它会工作吗?不要猜测,试试看。重新创建问题并在您自己的服务器上进行测试。它应该会起作用,但是在告诉客户您已经解决了问题之前,您有责任测试更多的因素。有关更多信息,请参阅