Skip to content

Commit

Permalink
Add post request timeout, add request body to the log
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotkk committed May 15, 2024
1 parent 5f8db94 commit aca12b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ events {
worker_processes auto;

http {
log_format upstreamlog '[$time_local] $request $status $host - $remote_addr to: $upstream_addr - urt: $upstream_response_time msec: $msec req_t: $request_time ($http_referer $http_user_agent)';
log_format upstreamlog '[$time_local] $request $status - $request_body - $host - $remote_addr to: $upstream_addr - urt: $upstream_response_time msec: $msec req_t: $request_time ($http_referer $http_user_agent)';
access_log /var/log/nginx/access.log upstreamlog;

limit_req_zone $binary_remote_addr zone=one:10m rate=200r/s;
Expand Down
3 changes: 2 additions & 1 deletion proxy/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def post_request(url, json, cookies=None):
return requests.post(
url,
json=json,
cookies=cookies
cookies=cookies,
timeout=30
)
except requests.exceptions.RequestException:
return None
Expand Down

0 comments on commit aca12b1

Please sign in to comment.