Hello!
On Wed, May 29, 2013 at 7:27 PM, David | StyleFlare wrote:
> Ideally this should require no fancy stuff.
>
> I simply want to return 403 + a json body {msg:'please use https' }
> for users who try to access the site over http.
>
It's easy, for example,
rewrite_by_lua '
if ngx.var.scheme == "http" then
ngx.status = 403
ngx.print([[{"msg":"please use https"}]])
ngx.exit(403)
end
';
Best regards,
-agentzh