# Http-request set-uri not working

**URL:** <https://discourse.haproxy.org/t/http-request-set-uri-not-working/4612>\
**Category:** Help!\
**Created:** [December 10, 2019, 12:16pm UTC](https://discourse.haproxy.org/t/http-request-set-uri-not-working/4612 "2019-12-10T12:16:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cm-vdp](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@cm-vdp](https://discourse.haproxy.org/u/cm-vdp)\
**Post date:** [December 10, 2019, 12:16pm UTC](https://discourse.haproxy.org/t/http-request-set-uri-not-working/4612/1 "2019-12-10T12:16:30Z")

</div>

This is what I want:

[www.our-domain.com/api](http://www.our-domain.com/api) --\> server.internal.corp:8243/

Frontend:  
acl api\_url url\_beg -i /api  
acl host\_wso2 hdr\_dom(Host) -i [www.our-domain.com](http://www.our-domain.com)  
use\_backend WSO2API if host\_wso2 api\_url

Backend:  
backend WSO2API  
http-request set-uri %[url,regsub(^/api,/,)] if { path\_beg /api }  
server server1 server.internal.corp:8243 maxconn 32 check inter 5000 source 10.100.254.49

But It doesn’t work:  
haroxy log  
Dec 10 11:42:41 HAPX-DMZ1-01 haproxy[13073]: 10.100.11.137:50816 [10/Dec/2019:11:42:41.187] WSO2~ WSO2API/server1 13/0/1/-1/18 502 229 - - SH-- 3/2/0/0/0 0/0 {[www.our-domain.com](http://www.our-domain.com)} {0,"","",“[www.our-domain.com](http://www.our-domain.com)”} “GET /api HTTP/1.1” “{[www.our-domain.com](http://www.our-domain.com)}”

application logging:  
10.100.254.49 - - [10/Dec/2019:11:42:41 +0100] GET /favicon.ico HTTP/1.1 405 832 [https://www.our-domain.com/api](https://www.our-domain.com/api) Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 0.004

So as I can see, the right backend is used but not the regsub.  
Where do I go wrong ?  
We are using haproxy 2.0.8

---

<div class="post-metadata">

**Author:** ![cm-vdp](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@cm-vdp](https://discourse.haproxy.org/u/cm-vdp)\
**Post date:** [December 10, 2019, 4:44pm UTC](https://discourse.haproxy.org/t/http-request-set-uri-not-working/4612/2 "2019-12-10T16:44:46Z")

</div>

Problem Solved.  
In another log-file a saw this:  
WARN {org.apache.synapse.transport.passthru.SourceHandler} - I/O error: Unrecognized SSL message, plaintext connection?

So I changed the backend to:  
server server1 server.internal.corp:8243 maxconn 32 check ssl verify none inter 5000 source 10.100.254.49
