Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31058940
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
ProdPasteBot
Nov 8 2019, 4:47 PM
2019-11-08 16:47:23 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
raw.txt
View Options
# Transparent proxy which passes requests to a set of un-pooled
# application servers that are reserved for debugging, based on
# the value of the X-Wikimedia-Debug header.
# The X-Wikimedia-Debug header is made up of semicolon-separated
# fields. Each field may consist of either an attribute name or
# an attribute=value pairs. The block below extracts the value of
# the 'backend' attribute. For backward-compatibility, if the
# header does not contain a well-formed 'backend' attribute, then
# the entire header is used as the backend value.
map_hash_bucket_size 128;
# Trims the content of X-Wikimedia-Debug to be just the first flag
map $http_x_wikimedia_debug $debug_backend {
"~backend=(?<h>[^;]+)" $h;
default $http_x_wikimedia_debug;
}
# Checks if php7 is selected
map $http_x_wikimedia_debug $php_engine {
"~; php7" "php7";
default "hhvm";
}
map $debug_backend $debug_host {
"~^((mwdebug1001|mwdebug1002)\\.eqiad\\.wmnet|(mwdebug2001|mwdebug2002)\\.codfw\\.wmnet)" $debug_backend;
"1" "mwdebug1001.eqiad.wmnet";
"mw1017.eqiad.wmnet" "mwdebug1001.eqiad.wmnet";
"mw1099.eqiad.wmnet" "mwdebug1002.eqiad.wmnet";
"mw2017.codfw.wmnet" "mwdebug2001.codfw.wmnet";
"mw2099.codfw.wmnet" "mwdebug2002.codfw.wmnet";
default 'invalid';
}
server {
listen [::]:80 ipv6only=off;
server_name _;
access_log /var/log/nginx/debug_proxy_access.log;
error_log /var/log/nginx/debug_proxy_error.log;
client_max_body_size 100m;
resolver 10.3.0.1;
location / {
if ($debug_host = invalid) {
return 400;
}
proxy_buffering off;
proxy_pass $scheme://$debug_host;
proxy_pass_request_headers on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Swap whatever cookie we had for PHP_ENGINE with what we extracted
set_by_lua_block $cookies {
local cookie_snippet_to_set = "PHP_ENGINE=" .. ngx.var.php_engine;
local current_engine = ngx.var.cookie_PHP_ENGINE;
if (ngx.var.http_cookie == nil) then
return cookie_snippet_to_set;
elseif (current_engine == nil) then
return ngx.var.http_cookie .. ";" .. cookie_snippet_to_set;
else
local php_engine_cookie = "PHP_ENGINE=" .. current_engine;
return string.gsub(ngx.var.http_cookie, php_engine_cookie, cookie_snippet_to_set);
end
}
proxy_http_version 1.1;
proxy_set_header Cookie $cookies;
proxy_set_header Host $host;
proxy_pass_header Server;
proxy_read_timeout 180s;
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8198880
Default Alt Text
raw.txt (2 KB)
Attached To
Mode
P9583 Masterwork From Distant Lands
Attached
Detach File
Event Timeline
Log In to Comment