what goes first urlrewrite or context
when a request hits lswd what fires first the REWRITE RULES or a possible PROXY CONTEXT?
I need a proxy context that hits
www.domain.com/directory but TARGETS the proxy IP with out the directory name that was in the context URI.
I assume that my rewrite rule should be something like:
RewriteRule ^vanguardia/(.*)$ http://192.168.120.120/$1 [R=301,L]
where my VH is
but needs to target the webserver destiny with out the directory
any ideas on whats wrong?
not very clear about your request.
ok let me put it in other way
VH IP: 192.168.120.120
Context /vanguardia/ (type proxy)
WebServer external app: 184.108.40.206:80
If I hit http://192.168.120.120/vanguardia
it will proxy the request to: http://220.127.116.11:80/vanguardia
my goal is to proxy the request EXCLUDING the context of the VH so it would just proxy to "http://18.104.22.168:80" with out the context directory.
I am confuse on how the effect is on the rewriterule engine vs the target webserver.
I've tried for hours using the P flag and many Regex.
any ideas on how to acomplish?
is there a variable for the ReWrite to match the target webserver? or is there a way to rewrite the target webserver external app?
now almost clear, thanks for clarification.
you can use rewriterule on virtual host(not .htaccess), and don't define any context. i.e., use virtual host level rewriterule to control all.
as before, define a web server external app:
the rewriterule in virtual host:
RewriteRule /vanguardia/(.*) http://test-proxy/$1 [P]
this should work as you expect.
that very interesting :) the reason I was using the context is because I needed cache, but I assume I could also call the cache functionality using the same rewrite engine and that will overwrite the context right?
so, correct me if I am right.. in order of importance there is
where from bottom to top it will overwrite one another.
I am trying to use regex magic product to make some advance matches but it asks me for the type of regex engine.. rewrite module uses the perl flavor?, it has like 8 types :S
I assume its the perl.
not sure, but apache compatible, so look up apache document may get the answer.
to enable cache:
RewriteRule /vanguardia/(.*) http://test-proxy/$1 [P, E=Cache-Control:max-age=60]
I recommend you focus on vhost rewriterule only in your case. don't use .htaccess and context for less confusion and better performance.
|All times are GMT -7. The time now is 05:47 AM.|