문제

this should be a pretty simple rewrite rule, but I can't get it working. I want to rewrite Request as follows:

http://acme.org/FOO/BAR

to

http://FOO.acme.org/BAR

FOO is some simple string in this case and BAR should match the rest of the URL. It seems as reqrep does not allow the rewrite of the host :(

도움이 되었습니까?

해결책

But nowadays it's better to replace host with

http-request replace-header Host .* FOO.acme.org

since reqirep is deprecated since haproxy 1.6.

다른 팁

You can rewrite the host with reqrep, try this:

acl match path_end -i /FOO/BAR
reqirep ^Host: Host:\ FOO.acme.org if match
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top