mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 11:39:59 +05:00
docs(nginx): add websocket rate limit to the advanced nginx configuration
This commit is contained in:
parent
a5df4cc9bc
commit
1e0c06ad8a
@ -23,6 +23,9 @@ server {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# Websocket connections rate limiting
|
||||
limit_req_zone $binary_remote_addr zone=wslimit:20m rate=30r/m;
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
@ -190,6 +193,10 @@ server {
|
||||
# We prefer to serve static content from nginx directly and to leave the API server to handle
|
||||
# the dynamic content that only it can manage. This is primarily an optimization
|
||||
location ^~ /cryptpad_websocket {
|
||||
# Websocket connections rate limiting
|
||||
limit_req zone=wslimit burst=5 nodelay;
|
||||
limit_req_status 429;
|
||||
|
||||
# XXX
|
||||
# static assets like blobs and blocks are served by clustered workers in the API server
|
||||
# Websocket traffic still needs to be handled by the main process, which means it needs
|
||||
|
||||
Loading…
Reference in New Issue
Block a user