On Wed, Oct 28, 2015 at 9:23 PM, Susheel Jalali
<susheel.jal...@coscend.com> wrote:
> Dear Baptiste, Ben and Jesse,
>
> We have been facing the same issue that HAProxy backend is not able to
> pull the right Web servers using our local DNS.  We applied Baptiste’s
> updated patches to server.c and dns.c and re-installed with a clean
> make/make install.  Still the same erroneous result.
>
> Hope the following test results help resolve the DNS issue.  If the
> issue is already resolved, please let us know what we could be missing?
>
> In our case, Product1, Product2, Product3 are being served by the same
> Web server and same port.  The logs show that the request to backend
> “product1” is getting redirected to product1.local.domain, default
> backend and to other backend servers (product2.local.domain,
> product3.local.domain).
>
> Here are the HAProxy configuration, relevant “info” logs and the patches
> applied.  We would appreciate any vectors.
>
> Patches applied:
> 0001 (UPDATED): http://marc.info/?l=haproxy&m=144605173426350&w=2
> 0002: http://marc.info/?l=haproxy&m=144605551527649&q=p3
>
> +++++++++++
> HAProxy Configuration
> +++++++++++
> global
> [..]
>
> defaults
> [..]
>
> frontend webapps-frontend
>      #Product1
>      acl host_https    req.hdr(Host) <FQDN>
>      acl path_subdomain_p1 path_beg -i /Product1
>      use_backend subdomain_p1-backend if host_https path_subdomain_p1
>
>      #Product2
>      acl host_https    req.hdr(Host) <FQDN>
>      acl path_subdomain_p2 path_beg -i /Product2
>      use_backend subdomain_p2-backend if host_https path_subdomain_p2
>
>      default_backend webapps-backend
>
> backend webapps-backend
>      server server-id DefaultProductServer.internal.domain:80 check
>
> backend subdomain_p1-backend
>      http-request set-header Host <internal_IPxx.yy.zz.ww:APPLICATION_PORT>
>
>      reqirep ^([^\ ]*)\ /Product1/*([^\ ]*)\ (.*)$       \1\ /\2\ \3
>      rspirep ^(Location:)\ (https?://([^/]*))/(.*)$    Location:\
> /Product1/\3
>
>      server <server-id> <servername1.internal.domain>:80 check resolvers
> haproxy-dns
>
> backend subdomain_p2-backend
>      [..]
>
> resolvers HAProxy-dns
>       nameserver dnsserver 10.10.10.1:53
>       resolve_retries       3
>       timeout retry         1s
>       hold valid           10s
>
> ++++++++++
> Logs:  Info
> ++++++++++
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /Product1/ HTTP/1.1" 302 235 "" ""
> 49936 640 "webapps-frontend~" "subdomain_p1-backend" "Product1.prod0" 33
> 0 0 5 38 ---- 1 1 0 0 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /Product1/ HTTP/1.1" 302 235 "" ""
> 49936 640 "webapps-frontend~" "subdomain_p1-backend" "Product1.prod0" 33
> 0 0 5 38 ---- 1 1 0 0 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET
> /Product1/interface/login/login_frame.php?site=default HTTP/1.1" 200
> 1159 "" "" 49936 678 "webapps-frontend~" "subdomain_p1-backend"
> "Product1.prod0" 4 0 0 15 19 ---- 1 1 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET
> /Product1/interface/login/login_frame.php?site=default HTTP/1.1" 200
> 1159 "" "" 49936 678 "webapps-frontend~" "subdomain_p1-backend"
> "Product1.prod0" 4 0 0 15 19 ---- 1 1 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/themes/style_oemr.css
> HTTP/1.1" 404 283 "" "" 49936 698 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.prod0" 22 0 1 6 29 ---- 3 3 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/themes/style_oemr.css
> HTTP/1.1" 404 283 "" "" 49936 698 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.prod0" 22 0 1 6 29 ---- 3 3 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/login/login_title.php
> HTTP/1.1" 404 283 "" "" 49936 727 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.prod0" 3 0 1 2 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/login/login_title.php
> HTTP/1.1" 404 283 "" "" 49936 727 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.prod0" 3 0 1 2 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/login/filler.php HTTP/1.1"
> 404 278 "" "" 49941 733 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.prod0" 2 0 0 2 4 ---- 5 5 1 2 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/login/filler.php HTTP/1.1"
> 404 278 "" "" 49941 733 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 2 0 0 2 4 ---- 5 5 1 2 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/login/login.php HTTP/1.1"
> 404 277 "" "" 49942 733 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 4 0 0 2 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /interface/login/login.php HTTP/1.1"
> 404 277 "" "" 49942 733 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 4 0 0 2 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /Product1/interface/themes/login.css
> HTTP/1.1" 200 5603 "" "" 49936 734 "webapps-frontend~"
> "subdomain_p1-backend" "Product1.VM0" 3 0 0 5 8 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:51:41 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:51:41 +0000] "GET /Product1/interface/themes/login.css
> HTTP/1.1" 200 5603 "" "" 49936 734 "webapps-frontend~"
> "subdomain_p1-backend" "Product1.VM0" 3 0 0 5 8 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /Product2/ HTTP/1.1" 302 235 "" ""
> 50017 378 "webapps-frontend~" "subdomain_p2-backend" "Product2.VM0" 2 0
> 0 6 8 ---- 1 1 0 0 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /Product2/ HTTP/1.1" 302 235 "" ""
> 50017 378 "webapps-frontend~" "subdomain_p2-backend" "Product2.VM0" 2 0
> 0 6 8 ---- 1 1 0 0 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET
> /Product2/interface/login/login_frame.php?site=default HTTP/1.1" 200
> 1159 "" "" 50017 386 "webapps-frontend~" "subdomain_p2-backend"
> "Product2.VM0" 2 0 0 18 20 ---- 1 1 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET
> /Product2/interface/login/login_frame.php?site=default HTTP/1.1" 200
> 1159 "" "" 50017 386 "webapps-frontend~" "subdomain_p2-backend"
> "Product2.VM0" 2 0 0 18 20 ---- 1 1 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/themes/style_oemr.css
> HTTP/1.1" 404 283 "" "" 50017 406 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 8 0 0 2 10 ---- 3 3 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/themes/style_oemr.css
> HTTP/1.1" 404 283 "" "" 50017 406 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 8 0 0 2 10 ---- 3 3 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/login/login_title.php
> HTTP/1.1" 404 283 "" "" 50017 417 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 3 0 1 1 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/login/login_title.php
> HTTP/1.1" 404 283 "" "" 50017 417 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 3 0 1 1 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/login/login.php HTTP/1.1"
> 404 277 "" "" 50017 423 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 2 0 1 1 4 ---- 5 5 1 2 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/login/login.php HTTP/1.1"
> 404 277 "" "" 50017 423 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 2 0 1 1 4 ---- 5 5 1 2 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/login/filler.php HTTP/1.1"
> 404 278 "" "" 50023 423 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 3 0 0 3 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /interface/login/filler.php HTTP/1.1"
> 404 278 "" "" 50023 423 "webapps-frontend~" "webapps-backend"
> "DefaultProductServer.VM0" 3 0 0 3 6 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /Product2/interface/themes/login.css
> HTTP/1.1" 200 5603 "" "" 50022 423 "webapps-frontend~"
> "subdomain_p2-backend" "Product2.VM0" 4 0 0 5 9 ---- 5 5 0 1 0 0 0 "" ""
>
> Oct 28 14:56:02 localhost haproxy[12167]: 192.168.100.153 - -
> [28/Oct/2015:19:56:02 +0000] "GET /Product2/interface/themes/login.css
> HTTP/1.1" 200 5603 "" "" 50022 423 "webapps-frontend~"
> "subdomain_p2-backend" "Product2.VM0" 4 0 0 5 9 ---- 5 5 0 1 0 0 0 "" ""
>
> -- --
> Sincerely,
>
> Susheel Jalali
> Coscend Communications Solutions
> susheel.jal...@coscend.com
>
> www.Coscend.com
> -------------------------------------
>


Hi Susheel,

I don't think your issue is related to DNS resolution.
When you have the 404, your URL does not start with /Product1, that's
why they are not redirected to Product1 backend.

Baptiste

Reply via email to