Understanding How to Discard a Response

Asked 2 years ago, Updated 2 years ago, 129 views

I'm a beginner at Flask/Python.

To prevent unauthorized access,
I want to respond to unauthorized access attacks by discarding the response when I receive an unauthorized URL.
If you look at other sites, there were things like sending binaries endlessly as a huge image file, but I don't want to load the server, and if I send response 400, it will speed up the next attack. Is there a way to deal with it with Flask?
I can handle Node.js without performing response.end related...

If you know more, please let me know.

python flask

2022-09-30 20:11

1 Answers

In a typical production environment, an HTTP server, such as nginx, handles the route before Flask processes it, so you should not respond to URLs that do not match at the time of the HTTP server.

Reference Page: How can I tell nginx to silently ignore requests that don't match and let them time out install of giving 404

The link above provides a technique for deliberately writing the action of returning HTTP response 444 on nginx so that nothing actually answers.


2022-09-30 20:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.