# Http-request set-path not working

**URL:** https://discourse.haproxy.org/t/http-request-set-path-not-working/4327
**Category:** Help!
**Created:** [September 25, 2019, 12:13pm UTC](https://discourse.haproxy.org/t/http-request-set-path-not-working/4327 "2019-09-25T12:13:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![void\_in](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@void\_in](https://discourse.haproxy.org/u/void_in)
#### Post date: [September 25, 2019, 12:13pm UTC](https://discourse.haproxy.org/t/http-request-set-path-not-working/4327/1 "2019-09-25T12:13:08Z")

</div>

I am using haproxy version 2.0.6. Following are the relevant front and back ends:

frontend test  
bind 127.0.0.1:1234  
mode http  
option httplog  
option http-buffer-request  
acl receipt req.body -m reg data  
use\_backend receipt\_back if receipt  
default\_backend prod

backend receipt\_back  
http-request set-path /app2/receipt.jsp \<------------------  
mode http  
balance roundrobin  
option forwardfor  
server SERVER-1 192.168.1.1:443 ssl verify none check

Everything is working fine but the line http-request set-path /app2/receipt.jsp is not working. The default URL is /app1/receipt.jsp and logs are showing that although the backend selected is receipt\_back, the URL is still /app1/receipt.jsp

Output of haproxy -vv:  
HA-Proxy version 2.0.6 2019/09/13 - [https://haproxy.org/](https://haproxy.org/)  
Build options :  
TARGET = linux-generic  
CPU = generic  
CC = gcc  
CFLAGS = -O2 -g -fno-strict-aliasing -DTCP\_USER\_TIMEOUT=18  
OPTIONS = USE\_PCRE2=1 USE\_PCRE2\_JIT=1 USE\_THREAD=1 USE\_OPENSSL=1 USE\_ZLIB=1 USE\_CPU\_AFFINITY=1 USE\_SYSTEMD=1

Feature list : -EPOLL -KQUEUE -MY\_EPOLL -MY\_SPLICE -NETFILTER -PCRE -PCRE\_JIT +PCRE2 +PCRE2\_JIT +POLL -PRIVATE\_CACHE +THREAD -PTHREAD\_PSHARED -REGPARM -STATIC\_PCRE -STATIC\_PCRE2 -TPROXY -LINUX\_TPROXY -LINUX\_SPLICE -LIBCRYPT -CRYPT\_H -VSYSCALL -GETADDRINFO +OPENSSL -LUA -FUTEX -ACCEPT4 -MY\_ACCEPT4 +ZLIB -SLZ +CPU\_AFFINITY -TFO -NS -DL -RT -DEVICEATLAS -51DEGREES -WURFL +SYSTEMD -OBSOLETE\_LINKER -PRCTL -THREAD\_DUMP -EVPORTS

Default settings :  
bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Built with multi-threading support (MAX\_THREADS=64, default=64).  
Built with OpenSSL version : LibreSSL 2.9.2  
Running on OpenSSL version : LibreSSL 2.9.2  
OpenSSL library supports TLS extensions : yes  
OpenSSL library supports SNI : yes  
OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2  
Built with transparent proxy support using: IP\_TRANSPARENT IP\_FREEBIND  
Built with zlib version : 1.2.7  
Running on zlib version : 1.2.7  
Compression algorithms supported : identity(“identity”), deflate(“deflate”), raw-deflate(“deflate”), gzip(“gzip”)  
Built with PCRE2 version : 10.32 2018-09-10  
PCRE2 library supports JIT : yes  
Encrypted password support via crypt(3): yes

Available polling systems :  
poll : pref=200, test result OK  
select : pref=150, test result OK  
Total: 2 (2 usable), will use poll.

Available multiplexer protocols :  
(protocols marked as cannot be specified using ‘proto’ keyword)  
h2 : mode=HTX side=FE|BE mux=H2  
h2 : mode=HTTP side=FE mux=H2  
 : mode=HTX side=FE|BE mux=H1  
 : mode=TCP|HTTP side=FE|BE mux=PASS

Available services : none

Available filters :  
[SPOE] spoe  
[COMP] compression  
[CACHE] cache  
[TRACE] trace

Thank you very much.

---

<div class="post-metadata">

### Author: ![void\_in](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@void\_in](https://discourse.haproxy.org/u/void_in)
#### Post date: [September 26, 2019, 6:57am UTC](https://discourse.haproxy.org/t/http-request-set-path-not-working/4327/2 "2019-09-26T06:57:58Z")

</div>

Never mind. The issue is that by default HAProxy logs the request URI it receives from the client and not the request URI after set-path that is why the logs will always show the original req.uri. The above configuration works as intended. Thanks
