mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Apply a request rewrite to what the server is sent
A rewrite only reached the copy of the request kept for logging. On a direct connection the server is sent the request line held in the header buffer, which was parsed and reduced to its path before the filters ran, so the rewrite showed up in the log and nowhere else. Through an HTTP parent the rewritten copy is what goes out, which is why it appeared to work there. Splice the new path back into that buffer. The destination was chosen, and the access rules applied to it, before the rewrite happened, so a rewrite that changes the method or the authority is left alone: acting on it would send the request somewhere the rules never saw. Say so in the manual. The copy needed to notice a rewrite is only taken when a request filter exists, so a proxy without one does no extra work.
This commit is contained in:
1 parent
cdbd47dc5b
commit
fdd303ee32
3 files changed
+137
-9
No files matched your search
@@ -1485,6 +1485,12 @@ REGEXP - PCRE (Perl) regular expression. Use * if no regexp matching is required
|
||||
REWRITE_EXPRESSION - substitution string. May contain Perl-style substrings
|
||||
$1, $2, etc. $0 means the whole matched string. \er and \en may be used
|
||||
to insert new lines; the string may be empty ("").
|
||||
.br
|
||||
A rewritten request is what the server receives. The destination is chosen,
|
||||
and the access rules are applied to it, before the filters run, so a rewrite
|
||||
that names another host or changes the method is logged but not acted on:
|
||||
the request is still sent where the access rules allowed. Rewriting the path
|
||||
or the query works on a direct connection and through a parent alike.
|
||||
|
||||
ACE - access control entry (user names, source IPs, destination IPs, ports, etc.),
|
||||
identical to allow/deny/bandlimin commands. The regular expression is only
|
||||
|
||||
Reference in new issue
Block a user