HAProxy List,
I am attempting to have traffic route to HAProxy using different root contexts
in the path. I would like to keep that root context in the users browser and
just concatenate an application's path changes as a suffix. So, for example:
1. User enters /testensc in there browser.
2. HAProxy scans for testensc and uses an ACL to route the traffic to a
specific back-end
3. Uses reqrep and/or rsprep to properly modify the request for server
purposes, but the user is never made aware of this in the browser
4. Opening page user sees has URL /testensc/login.apsx (for
example)
5. All subsequent pages after logging in maintain the root context.
I have not been able to get #4 and #5 to work. If I need to modify the
application level to make this work that is fine, but was hoping HAProxy could
somehow handle this for me.
Below are config file snippets from each section. I originally tried just the
reqrep line but also tried rsprep as well upon suggestion. Neither seems to
make a difference in action. Right now, for debugging purposes, the web and
default servers are similar but eventually the default will be written to
handle any non-standard traffic. I included it also so the attached log snippet
makes sense. It looks like initial request gets routed to the web server
instance (web_ensc), but subsequent requests are going to the default server
(default_ensc), since the URL no longer seems to contain the "testensc" string.
Any suggestions on things to try?
Thanks,
Zack
frontend http-web-service
bind xx.xx.xx.xx:443 ssl crt /usr/local/haproxy/ssl/combined.pem
ca-ignore-err all #redacted
# Tests for WebSite traffic
acl acl_ensc path_reg ^/testensc
# Back-end Redirects - WebSite Endpoints
use_backend web_ensc if acl_ensc
default_backend default_ensc
backend web_ensc
balance source
reqrep ^([^\ :]*)\ /testensc(.*) \1\ /\2
rsprep ^([^\ :]*)\ /(.*) \1\ /testensc\2
server webapp1 xx.xx.xx.xx:80 check #redacted
backend default_ensc
balance source
reqrep ^([^\ :]*)\ /testensc(.*) \1\ /\2
rsprep ^([^\ :]*)\ /(.*) \1\ /testensc\2
server webapp1 192.168.0.245:80 check #redacted
May 14 11:22:19 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3477
[14/May/2013:11:22:19.980] http-web-service~ web_ensc/webapp1 9/0/0/3/12 200
688 - - 0/0/0/0/0 0/0 {yy.yy.yy.yy4Mozilla/4.0 (compatible; MSIE 8.0;
Windows NT 5.1;|} {Microsoft-IIS/6.0||} "GET /testensc HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3478
[14/May/2013:11:22:20.023] http-web-service~ default_ensc/webapp1 9/0/0/3/13
200 12230 - - 0/0/0/0/0 0/0 {yy.yy.yy.yy4Mozilla/4.0 (compatible; MSIE
8.0; Windows NT 5.1;|} {Microsoft-IIS/6.0||} "GET /login.aspx HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3484
[14/May/2013:11:22:20.072] http-web-service~ default_ensc/webapp1 25/0/0/6/31
200 4530 - - 5/5/5/5/0 0/0 {yy.yy.yy.yy4|https://yy.yy.yy.yy|||Mozilla/4.0
(compatible; MSIE 8.0; Windows NT 5.1;|} {Microsoft-IIS/6.0||} "GET
/scripts/jquery.cookie.js HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3483
[14/May/2013:11:22:20.073] http-web-service~ default_ensc/webapp1 21/0/1/23/50
200 35210 - - 5/5/4/4/0 0/0
{yy.yy.yy.yy4|https://yy.yy.yy.yy|||Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 5.1;|} {Microsoft-IIS/6.0||} "GET /css/jquery-ui.css HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3479
[14/May/2013:11:22:20.071] http-web-service~ default_ensc/webapp1 23/0/1/16/52
200 72207 - - 4/4/4/4/0 0/0
{yy.yy.yy.yy4|https://yy.yy.yy.yy|||Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 5.1;|} {Microsoft-IIS/6.0||} "GET /scripts/jquery-1.4.1.min.js HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3485
[14/May/2013:11:22:20.109] http-web-service~ default_ensc/webapp1 13/0/1/2/19
200 31194 - - 3/3/3/3/0 0/0
{yy.yy.yy.yy4|https://yy.yy.yy.yy|||Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 5.1;|} {Microsoft-IIS/6.0||} "GET
/ScriptResource.axd?d=VQ96-evPCM-Qu8g0-QIKDL_eZsS8yU9LTG0xFhePwXur-U-ga-BQLeUVMtwgo2PZciFewLOCynayDq2rgoamT3zvOZUC9tQsCtK6Lh1LOC81AjDYho7AQ05RZRMJfE_20&t=bd2983fc
HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3481
[14/May/2013:11:22:20.072] http-web-service~ default_ensc/webapp1 22/0/0/31/56
200 26370 - - 2/2/2/2/0 0/0
{yy.yy.yy.yy4|https://yy.yy.yy.yy|||Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 5.1;|} {Microsoft-IIS/6.0||} "GET /scripts/en_scripts.js HTTP/1.1"
May 14 11:22:20 localhost.localdomain haproxy[5926]: xx.xx.xx.xx:3480
[14/May/2013:11:22:20.072] http-web-service~ default_ensc/webapp1 22/0/0/34/59
200 34833 - - 1/1/1/1/0 0/0
{yy.yy.yy.yy4|https://yy.yy.yy.yy|||Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 5.1;|} {Microsoft-IIS/6.0||} "GET /css/en_s