Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hathor/p2p/resources/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def render_GET(self, request):
StatusResource.openapi = {
'/status': {
'x-visibility': 'public',
# The /status endpoint has a large reponse, so we need to increase the buffer size of the proxy
'x-proxy-buffers': '16 16k',
'x-rate-limit': {
'global': [
{
Expand Down
4 changes: 4 additions & 0 deletions hathor_cli/nginx_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def generate_nginx_config(openapi: dict[str, Any], *, out_file: TextIO, rate_k:
location_params: dict[str, Any] = {
'rate_limits': [],
'path_vars_re': params.get('x-path-params-regex', {}),
'proxy_buffers': params.get('x-proxy-buffers'),
}

allowed_methods = {'OPTIONS'}
Expand Down Expand Up @@ -340,6 +341,9 @@ def generate_nginx_config(openapi: dict[str, Any], *, out_file: TextIO, rate_k:
out_file.write(' ' * 8 + f'limit_except {methods} {{ deny all; }}\n')
for rate_limit in location_params.get('rate_limits', []):
out_file.write(' ' * 8 + rate_limit.to_nginx_config())
proxy_buffers = location_params.get('proxy_buffers')
if proxy_buffers:
out_file.write(' ' * 8 + f'proxy_buffers {proxy_buffers};\n')
out_file.write(location_close)
out_file.write(server_close)

Expand Down