-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store all requests to pages hosted by BugHog and minor fixes
- Loading branch information
Showing
6 changed files
with
93 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# We want to notify worker-specific request collectors of every request to our experiment server. | ||
# Hacky solution: pretend that the collector is not reachable and use fallback to serve experiment page. | ||
# So: | ||
# 1. NGINX will send request to request collector of worker. | ||
# 2. NGINX will serve the experiment page. | ||
|
||
proxy_pass http://$remote_addr:5001/report/; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
|
||
proxy_method POST; | ||
proxy_set_header Content-Type "application/json"; | ||
|
||
set $request_body_data ''; | ||
if ($request_body) { | ||
set $request_body_data "$request_body"; | ||
} | ||
|
||
set $url '"url": "${scheme}://${host}${request_uri}"'; | ||
set $method '"method": "$request_method"'; | ||
set $content '"content": "${request_body_data}"'; | ||
set $report '{${url}, ${method}, ${content}}'; | ||
proxy_set_body $report; | ||
|
||
# We don't need any response, we merely want to notify | ||
proxy_connect_timeout 2s; | ||
proxy_send_timeout 2s; | ||
proxy_read_timeout 0s; # Force a 504 by setting timeout to 0 | ||
|