Beego 备忘
时间:2021-08-30 05:23:58
收藏:0
阅读:9
IsSecure() func 失效问题
nginx部署好https后,this.Ctx.Input.IsSecure() 返回 false的
解决方法,nginx的conf中需要加入 proxy_set_header X-Forwarded-Proto $scheme;
location / {
try_files /_not_exists_ @backend;
}
location @backend {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8083;
}
原文:https://www.cnblogs.com/au_ww/p/15194863.html
评论(0)