307临时重定向不工作nginx 1.18
我部署了Apirest和其他服务需要登录。...最后几天正常工作,因为我确实使用了HTTP,今天安装HTTPS,所有请求帖子/与HTTPS一起使用良好,但可以尝试使用相同的端点重定向不起作用。
我的目标是使用http:// ..或https:// ...
我对这种情况进行了研究,所有ppl都讨论了307/308,但对我不起作用,
但
server {
listen 80;
listen [::]:80;
server_name mydomain.com;
return 307 https://$server_name$request_uri;
}
在这个案例我尝试了307和308,但不起作用 我看到access.log,nginx重定向URL带有方法获取时,当我的请求与port
- 我的nginx版本为1.18时,
- 我的域是在Cloudflare中注册的。...我对这是否是问题
- 重新启动服务和重新启动服务器有疑问。 ...我有同样的错误
吗?
I deployed apirest and others service need it login.... last days work fine because i did use http, today install https and all request post/get work fine with https but y i try it call same endpoint redirect not work.
My objective is call transparent way when use http://.... or https://...
i researched about this case and all ppl talk about 307/308 but not work for me
nginx - sites-enabled/default
server {
listen 80;
listen [::]:80;
server_name mydomain.com;
return 307 https://$server_name$request_uri;
}
in this case i tried it with 307 and 308 but not work
i see that access.log, nginx redirect url with method GET when my request is with POST
- my nginx version is 1.18
- my domain is register in cloudflare.... i have a doubts about if this is the problem
- restart service and restart server.... and i have same error
pls any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以解决这个问题。...
我尝试了Cloudflare中的多样化配置...我检测到当字段始终使用HTTPS处于活动状态时,它们在菜单SSL/TLS&GT中修改了所有请求。边缘证书
,仅在此选项中删除
,我确认返回308与此配置使用:
#update 05/07/2022
我在激活其他服务器中激活http/https时检测到其他问题,并且domian由Cloudflare管理,
我需要我激活了“ DNS管理”中的“代理”检查,因为我在vb.net的应用中遇到了问题
i can fixed this problem....
I tried diversitieds config in cloudflare... and i detected that they modified all request when the field Always Use HTTPS is active, in menu SSL/TLS > Edge Certificate
and only desctivated this option
also, i confirmated that return 308 work fine with this config:
#Update 05/07/2022
I detected other problem related when i activated http/https in other server and the domian is administrated by Cloudflare
i needed activated the check "Proxied" in "DNS Management" because i had a problem in an application with vb.net
对我来说,307临时重定向不是来自NGINX,而是来自Apache流量服务器的redirect_temporary -drivective,该指示性用作代理主机。
在您的情况下,我会怀疑类似的事情,也许307来自Cloudflare,而不是Nginx?您可以检查浏览器检查员的响应,并仔细检查响应,例如,是否建议除Nginx以外的其他服务器。
For me, 307 temporary redirect did not come from nginx, but from Apache Traffic Server's redirect_temporary -directive, which was used as proxy host.
In your case I would suspect something similar, maybe 307 comes from Cloudflare and not from nginx? You can inspect the response by Browser inspector and carefully check the response, if it e.g. suggests some other server than nginx.