Forum Discussion
serebra_83282
Nimbostratus
Jul 08, 2009ProxyPass problem
Greetings,
I followed the instruction on http://devcentral.f5.com/wiki/default.aspx/iRules/ProxyPass to set up ProxyPass and got problem.
In browser, it said:
Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again.
In Big-IP log /var/log/ltm, it said:
Jul 8 16:46:24 tmm tmm[1577]: 01220001:3: TCL error: ProxyPass - beta while executing "virtual name"
Here are the configurations:
virtual beta {
pool betapool
destination 172.16.0.24:http
ip protocol tcp
rules ProxyPass
profiles
http
oneconnect
tcp
}
class ProxyPassbeta {
" www.site1.com/support www.site2.com/support"
}
BIG-IP 9.4.3 Build 1.4
Idea?
Thank you!
12 Replies
- hoolio
Cirrostratus
You could try replacing instances of [virtual name] with [virtual]. I thought in 9.4.0+ the two were synonymous.
Aaron - serebra_83282
Nimbostratus
Yes, it fixes the problem by replaceing [virtual name] with [virtual].
However, I got the other error, and here is info from /var/log/ltm:
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Looking for entries matching www.site1.com/support/
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Found Rule, Client Host=www.site1.com, Client Path=/support, Server Host=www.site2.com, Server Path=/support
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: New Host=www.site2.com, New Path=/support/
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Using default pool betapool
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Removed Accept-Encoding header
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: $stream_expression_cmd: STREAM::expression "@www.site2.com/support@www.site1.com/support@", $stream_enable_cmd: STREAM::enable
Jul 9 11:01:42 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Error setting stream expression (). If you enable $::RewriteResponsePayload, then you should add a stream profile to the VIP. Else, set $::RewriteResponsePayload to 0 in this iRule.
Idea?
Thank you!
Victor - serebra_83282
Nimbostratus
I added stream profile to the virtual machine (beta),
virtual beta {
pool betapool
destination 172.16.0.24:http
ip protocol tcp
rules ProxyPass
profiles
http
oneconnect
stream
tcp
}
Then I got following things in /var/log/ltm:
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Looking for entries matching www.site1.com/support/
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Found Rule, Client Host=www.site1.com, Client Path=/support, Server Host=www.site2.com, Server Path=/support
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: New Host=www.site2.com, New Path=/support/
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Using default pool betapool
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Removed Accept-Encoding header
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: $stream_expression_cmd: STREAM::expression "@www.site2.com/support@www.site1.com/support@", $stream_enable_cmd: STREAM::enable
Jul 9 11:34:56 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Successfully configured and enabled stream filter
In browser, I got following error:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:
* Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
* If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
* Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)
Technical Information (for support personnel)
* Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404.
* Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages.
Idea?
Thank you,
Victor - hoolio
Cirrostratus
So you're trying to rewrite client requests made to www.site1.com/support to www.site2.com/support? It looks like you made a request for www.site1.com/support/, it was rewritten to www.site2.com/support/, it was sent to the beta and the server responded with a 404 - Not Found error. Does /support/ exist on the server set up to listen for www.site2.com requests? If you make a request direct to the server for www.site2.com/support/ does the page exist?
Aaron - serebra_83282
Nimbostratus
Yes, That is our goal to rewrite client requests made to www.site1.com/support proxy to www.site2.com/support
www.site2.com/support has an index page, and we can access it.
When we tried to access www.site1.com/support, we got Error (404 - File or directory not found). It seems that it directly go to the ServerA in betapool. We found it out in ServerA’s IIS log file. It meant ProxyPass did not rewrite the request.
By the way, www.site2.com/support is located outside of Big-IP. I am not sure whether it makes any difference.
Thank you,
Victor - hoolio
Cirrostratus
It looks like there might be a slight issue with the ProxyPass iRule's use of 'HTTP::header replace'. Can you find this line:HTTP::header replace Host: $host_serverside
and replace it with this line?HTTP::header replace Host $host_serverside
and this line:HTTP::header replace $header: $protocol$host_clientside$path_clientside[substr $server_path [string length $path_serverside]]
with this line:HTTP::header replace $header $protocol$host_clientside$path_clientside[substr $server_path [string length $path_serverside]]
and then retest?
Thanks,
Aaron - serebra_83282
Nimbostratus
OK, I have made change as you mentioned. Tested it, the error is still same as before (Error 404 - File or directory not found).
here is the log:
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Looking for entries matching www.site1.com/support/
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Found Rule, Client Host=www.site1.com, Client Path=/support, Server Host=www.site2.com, Server Path=/support
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: New Host=www.site2.com, New Path=/support/
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Using default pool betapool
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Removed Accept-Encoding header
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: $stream_expression_cmd: STREAM::expression "@www.site2.com/support@www.site1.com/support@", $stream_enable_cmd: STREAM::enable
Jul 9 16:39:32 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/: Successfully configured and enabled stream filter
Thank you very much,
Victor - hoolio
Cirrostratus
Can you add another HTTP_REQUEST event to log the value of the host header and URI without the effect of command caching?when HTTP_REQUEST priority 501 { log local0. "$log_prefix: Current Host header value: [HTTP::host], URI: [HTTP::uri]" }
Aaron - hoolio
Cirrostratus
I think using 'HTTP::header replace header_name: header_value' will work if a header name of header_name already exists. If it doesn't then a broken header is inserted:
header_name:: header_value
Aaron - serebra_83282
Nimbostratus
I added “HTTP_REQUEST priority 501” as you suggested, and also used 'HTTP::header replace header_name: header_value' to replace 'HTTP::header replace Host $host_serverside',but we still got same error as before.
When using 'HTTP::header replace Host $host_serverside', here is the log:
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Looking for entries matching www.site1.com/support/index.htm
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Found Rule, Client Host=www.site1.com, Client Path=/support, Server Host=www.site2.com, Server Path=/support
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: New Host=www.site2.com, New Path=/support/index.htm
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Using default pool betapool
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Removed Accept-Encoding header
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Current Host header value: www.site2.com, URI: /support/index.htm
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: $stream_expression_cmd: STREAM::expression "@www.site2.com/support@www.site1.com/support@", $stream_enable_cmd: STREAM::enable
Jul 10 09:41:54 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Successfully configured and enabled stream filter
When using 'HTTP::header replace header_name: header_value' , here is the log:
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Looking for entries matching www.site1.com/support/index.htm
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Found Rule, Client Host=www.site1.com, Client Path=/support, Server Host=www.site2.com, Server Path=/support
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: New Host=www.site2.com, New Path=/support/index.htm
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Using default pool betapool
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Removed Accept-Encoding header
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Current Host header value: www.site1.com, URI: /support/index.htm
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: $stream_expression_cmd: STREAM::expression "@www.site2.com/support@www.site1.com/support@", $stream_enable_cmd: STREAM::enable
Jul 10 10:04:59 tmm tmm[1577]: Rule ProxyPass : beta, Host=www.site1.com, URI=/support/index.htm: Successfully configured and enabled stream filter
Thank you,
Victor
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects