diff --git a/config/nginx.conf b/config/nginx.conf index 588f1a2..5934398 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -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; diff --git a/proxy/endpoints.py b/proxy/endpoints.py index ec2feb7..3166380 100644 --- a/proxy/endpoints.py +++ b/proxy/endpoints.py @@ -86,7 +86,7 @@ def to_dict(self): def url_ok(url) -> bool: try: - r = requests.head(url) + r = requests.head(url, timeout=10) return bool(r.status_code) except requests.exceptions.ConnectionError: return False diff --git a/proxy/helper.py b/proxy/helper.py index 945150e..cede321 100644 --- a/proxy/helper.py +++ b/proxy/helper.py @@ -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