How can you drop an HttpRequest connection in Django when TLS/SSL is not being used?

前端 未结 2 1281
一个人的身影
一个人的身影 2021-01-14 07:21

I\'m writing a Django 1.3 view method which requires TLS/SSL to be used. I want to entirely drop the connection if an HttpRequest is received without using TLS/SSL and NOT r

2条回答
  •  粉色の甜心
    2021-01-14 08:10

    If you are using Nginx as your front-end proxy then you can use another non-standard HTTP status code 444 which closes the connection without sending any headers. http://wiki.nginx.org/HttpRewriteModule#return It would require that Nginx know enough about which urls to deny on HTTP.

提交回复
热议问题