Jimmy
Jimmy

Reputation: 21

HAProxy and reqrep Rewriting Configuration

I'm trying to configurate Haproxy acl. For example, http://www.abc.com/test/test.html rewrite to http://www.abc.com/index.html. Please tell me how to do? thanks

reqrep ^([^\ :]*)\ /test/test.html     \1\ /index.html

but the web server feedback:

502 Bad Gateway

The server returned an invalid or incomplete response.

Upvotes: 2

Views: 6241

Answers (1)

jammy
jammy

Reputation: 39

Configuration for your request should be like this:

reqrep ^GET\ /test/test.html\ HTTP/1.1 GET\ /index.html\ HTTP/1.1

default_backend dyn_server

backend dyn_server
mode http
server web1 ip:port

Hope this will helps you

Upvotes: 3

Related Questions